A federal judge dismissed New York warehouse workers’ lawsuit against Amazon, ruling that their allegations about the company’s handling of the COVID-19 pandemic should have been brought to the Occupational Safety and Health Administration instead.

The lawsuit filed in June accused Amazon of creating a “public nuisance” by exacerbating COVID-19 risks, including by maintaining a “culture of workplace fear” in which workers are told to “work at dizzying speeds, even if doing so prevents them from socially distancing, washing their hands, and sanitizing their work spaces.”

U.S. District Judge Brian Cogan in Brooklyn, New York, ruled Sunday that the federal agency was better situated “to strike a balance between maintaining some level of operations in conjunction with some level of protective measures,” given courts’ lack of expertise on workplace safety and public health, and the risk that judges around the country would reach conflicting conclusions.

“Court-imposed workplace policies could subject the industry to vastly different, costly regulatory schemes in a time of economic crisis,” he wrote.

The workers’ lawyers said they were weighing an appeal of Cogan’s ruling. The judge’s deference to OSHA “should be very concerning to anyone who cares about the health of American workers, given that OSHA has been virtually AWOL throughout this crisis,” they said in a statement.

“Nothing is more important than the health and safety of our employees, which is why at the onset of the pandemic we moved quickly to make more than 150 COVID-19 related process changes,” Amazon spokesperson Lisa Levandowski said in an emailed statement. In legal filings, the company has denied wrongdoing and called the lawsuit an effort to “exploit the pandemic.”

Worker advocates have turned to public nuisance suits in part due to frustration with OSHA, which under President Donald Trump has rebuffed calls to issue binding regulations addressing the pandemic.

Two of the legal non-profits that brought the Amazon lawsuit, Towards Justice and Public Justice, are separately suing OSHA in a federal court in Pennsylvania, saying the agency has arbitrarily and capriciously failed to address “imminent dangers” to workers at a meatpacking plant in the state.