Walmart's same-day grocery-delivery partnership with Deliv has ended in a big setback for the retailer's race against Amazon (WMT, AMZN)

Walmart Inc and logistics firm Deliv pulled the plug on a key same-day grocery delivery partnership, dealing a setback in the retailer’s race against rival Amazon.com Inc to deliver groceries to customers’ homes.

The world’s largest retailer began bolstering its partnerships with third-party courier firms to reach consumers in 100 U.S. cities last year, after failing to use Uber and Lyft to deliver groceries, and struggling in its attempt to use its own employees to deliver goods.

Deliv, which was one of Walmart’s earliest partners with pilot programs in Miami and San Jose, served the retailer with a 90-day termination notice, and the two companies stopped working with each other in late January, according to two people familiar with the situation.

Walmart confirmed the previously unreported decision, and said it still partners with seven delivery firms, including DoorDash and Postmates, four of which it signed up in January.

Read more: Trader Joe’s is killing its grocery delivery program even as Walmart, Whole Foods, and Kroger spend billions to win the online grocery wars

People familiar with the Walmart partnership with Deliv said the Deliv drivers had to frequently wait 40 minutes or more to collect grocery orders when they showed up at the store. One reason for that, they said, is because Walmart gives a priority to customers over delivery drivers during regular hours, which complicated the partnership.

The store operations at Walmart “were a huge problem,” said one of the people with direct knowledge of the matter, adding the retailer could not “process online grocery orders fast enough.”

Deliv declined to comment. Walmart spokeswoman Molly Blakeman told Reuters the retailer and Deliv mutually decided to end the partnership. “As with any pilot, the intent is to learn. And we ultimately came to the conclusion with Deliv that while their platform is a good delivery option, it was not the best fit for our program at this time.”

Blakeman said same-day grocery delivery is currently available in 800 of its more than 5,000 U.S. stores and warehouse clubs, and the retailer plans to add 800 more this year.

Deliv offers scheduled same-day deliveries through gig drivers, a model which can work well with faster order processing and a better ability to predict demand and robust volumes. Walmart is now working mostly with restaurant delivery firms that deliver an order as and when it is generated, one of the sources said.

Both sources said order volumes were low in many markets, and one source said orders had to be delivered over large distances, resulting in both Deliv and Walmart losing money.

“When the partnership with Deliv was struck, the hope was that demand will be stronger than it is now,” one of the sources said.

Deliv operates in 1,400 U.S. cities, tapping into networks of local freelance drivers to deliver packages same-day for a fee for a range of retailers, from Home Depot Inc to Kohl’s Corp.

In October, it raised $40 million in a new round of financing from investors, including Alphabet Inc’s Google and United Parcel Service. In December, it signed up 20 new U.S. retailers including Nike Inc and Nordstrom.

Deliv can process and deliver thousands of orders in an hour. Walmart in San Jose was sometimes generating only a hundred orders a week, and there were problems processing that volume through stores, one of the sources said. Walmart is working to fix the problems at its stores to process orders faster, the source added.

Blakeman said there were no problems with order volume in the market.

The sources also told Reuters that Walmart has ended a separate grocery delivery test from 2017, in which it partnered with smart security company August Home and Deliv for keyless entries to shoppers homes, to deliver groceries directly to their refrigerator.