Pharmacy giant CVS Health posted a $2.56 billion loss for the most recent quarter and is blaming its lagging fortunes partly on the “deteriorating financial health of numerous skilled nursing facility customers.”

CVS made its first big foray into long-term care in 2015 when it acquired long-term care pharmacy services leader Omnicare for $12.9 billion. Although company officials reasserted that there is promise in the eldercare business, the skilled nursing side is not meeting expectations.

“We continue to see growth opportunities in the assisted living market, particularly, as the most efficient operator in the space,” said David Denton, executive vice president and chief financial officer. “That said, industry-wide financial challenges have created unexpected financial pressures on our facility clients, which has resulted in lower growth than we anticipated when we acquired the Omnicare business three years ago.”

He blamed several factors, including higher levels of bad debt, longer collection times on receivables, a faster decline of facility reimbursement rates than first forecast, and low client retention rates. Bed census at SNFs continue to track lower, he added, which has spelled fewer prescriptions across the Omnicare platform.

“And despite a growing opportunity in the assisted living market, our programs to serve these clients have grown more slowly than we originally anticipated,” he said.

As it looks toward 2019, CVS said it expects “continued deterioration in our financial results” in skilled nursing. Given the declining value of the Omnicare business compared to its hefty purchase price, CVS said they believed the asset was below its originally acquired value and, as such, the company was recording a “non-cash goodwill impairment charge” of $3.9 billion in the quarter.

CVS officials, however, said on Wednesday that they still believe in the future of the long-term care pharmacy market.

As a result, they’re taking significant steps to shore up the business, including: 1) installing a new leadership team, 2) targeting ways to better retain clients, and 3) finding efficiencies to help lower costs for skilled care customers. They’re targeting upward of $150 million in “cost takeout opportunities,” utilizing automation and better leveraging of its local presence.

“With the industry continuing to face financial challenges, being a low-cost provider will be even more important,” Denton said.

“We remain optimistic about Omnicare’s long-term growth potential and its relevance to our value-creation strategy,” Denton continued. “There is no doubt that as the population ages, there will be an increased need for long-term care services and supports. We must execute on initiatives, deliver high levels of patient and client service, and drive additional efficiencies so that when the market does turn around, we are well-positioned to take advantage and grow.”

In the bigger picture, CVS had a solid quarter overall, officials noted. The company posted $46.7 billion in net revenue this past quarter, up 2.2% from the second quarter of 2017. Its $20.7 billion in retail pharmacy revenue represented a 5.1% uptick compared to the same period last year.