(Reuters) - United Parcel Service Inc UPS.N shares slid 7.0 percent on Thursday after it gave a 2018 earnings forecast that fell short of analyst estimates and said it would spend at least $6.5 billion this year improving its delivery network.

The world's largest package delivery company and rival FedEx Corp FDX.N have already spent billions of dollars upgrading their networks to handle surging e-commerce package volumes, weighing on margins and leaving investors frustrated over the expense.

But UPS said on Thursday there was still work to be done. Network bottlenecks that delayed some deliveries during the key holiday season cost about $125 million. It spent $1.5 billion on capital in the quarter, and some $60 million on installing new technology and automated capacity.

“We are going to have significantly different capacity (by peak season 2018),” Chief Executive David Abney told Reuters after the company’s earnings topped Wall Street expectations but were overshadowed by the issue of spending and the 2018 earnings outlook.

The rapid rise in online shopping has been a boon for shipping demand, but UPS has struggled to bring down the extra costs of making more smaller deliveries to households, compared to businesses that on average receive more parcels at once.

The investments show UPS is betting that if it can handle more volume it can increase the number of packages it delivers to households, and eventually improve margins and profitability, versus pushing for higher prices and less volume, said Stephens analyst Jack Atkins.

“If they can’t get the delivery density - to date we haven’t seen a yearly improvement in density - that’s going to be a big problem,” Atkins said.

Analysts on a call to discuss the results pushed UPS executives on when investors would see improved margin growth at its core U.S. business and why the company had not increased prices more.

“We expect 2018 to have some challenges, because of the investment dollars,” Chief Financial Officer Richard Peretz said.

UPS said it would invest $6.5 billion to $7 billion in 2018, part of that on buying 14 Boeing 747-8 cargo jets and four Boeing 767s for its fleet. It plans 18 new or retrofitted facilities this year, including adding three U.S. ground hubs online later this year in areas where a surge in holiday online shopping orders overwhelmed its system.

UPS pegged its 2018 adjusted earnings per share at $7.03 to $7.37, with the lower end of that range falling short of the $7.16 per share analysts had been expecting on average.

Earlier Thursday, United Parcel Service Inc UPS.N, the world's largest package delivery company, reported a quarterly net profit on Thursday that was boosted by growth in deliveries in the U.S. and abroad and benefits from changes to U.S. tax law.

The Atlanta-based company posted fourth-quarter net income of $1.1 billion or $1.27 per share, up from a $239 million loss, or a loss of 27 cents per share a year earlier.

Adjusted for one-time items, UPS reported earnings per share of $1.67. Analysts expected earnings per share of $1.66.