Three pregnant women detained in a California jail say they lost their babies due to substandard medical care — with one claiming prison guards stopped at Starbucks on the way to the hospital.

In a recent update to a sweeping class-action lawsuit that alleged widespread abuse at an Orange County lock-up, the women say all three infant deaths might have been avoided if they were given the proper care.

Sandra Quinones, one of the plaintiffs, says she had been in custody for about six months when her water broke in 2016, according to KNBC. She hit the call button to ask for help, but jail deputies didn’t drive her to the hospital until more than two hours had passed.

On the way, Quinones alleges the guards pulled the car over at a local Starbucks to get coffee. Later, her baby died at the hospital.

A second plaintiff, Ciera Stoetling, says she started having contractions in May 2018, and informed a jail nurse. However, the nurse told her there wasn’t enough staff to take her to the hospital, and she would have to wait two more days.

Stoetling gave birth inside the jail, and the baby later died. The Orange County District Attorney’s Office concluded the death was natural, and the jail would not be at fault. In their report, they noted that Stoetling had been smoking methamphetamine while 23 weeks pregnant, and was a daily marijuana smoker, according to KNBC.

The third and most recent case cites an unnamed woman who says she was denied medical care in late July, when her baby had died at 27 weeks. She had been booked just days earlier on two misdemeanors, according to a press release.

The local sheriff’s office denied all of the allegations in a statement to the Orange County Register, saying the allegations are “rooted in a perspective that is anti-incarceration.”

The women are just three of many plaintiffs in the lawsuit, which was originally filed in April and documented a number of abuses inside the jail. The allegations included the wrongful monitoring and recording of private phone calls with attorneys, denial of religious services and reports of inmates being held in solitary confinement for years.