A New York State Supreme Court Justice on Friday rejected a request by 55 anti-vaccine families to block a recently passed state law eliminating exemptions to school vaccination requirements on the basis of religious beliefs.

According to the families’ attorneys, Justice Michael Mackey cited other court decisions that have held that states have the power to impose such restrictions to protect public health from the spread of infectious disease. Justice Mackey added that the families were unlikely to succeed if they tried to continue with the case.

Nevertheless, the attorneys in the case—Michael Sussman and the prominent anti-vaccine advocate Robert F. Kennedy Jr.—vowed to keep fighting. Kennedy’s anti-vaccine nonprofit, Children’s Health Defense, released a statement saying, “While this decision is a set-back, it isn’t the final decision. The case will move forward with more decisions to come.”

The families filed their case on Wednesday and sought class-action status. They claimed that the state’s June 13 decision to repeal religious exemptions is unconstitutional and violates their religious freedom.

The state’s action came amid a massive measles outbreak that has plagued New Yorkers since last September. Health officials have tallied 987 cases since then, mostly in unvaccinated children.

During the 2017-2018 school year, roughly 26,000 students in the state had religious exemptions from standard vaccinations.

Upon signing the repeal, New York Governor Andrew Cuomo released a statement saying:

The science is crystal clear: Vaccines are safe, effective and the best way to keep our children safe. This administration has taken aggressive action to contain the measles outbreak, but given its scale, additional steps are needed to end this public health crisis. While I understand and respect freedom of religion, our first job is to protect the public health and by signing this measure into law, we will help prevent further transmissions and stop this outbreak right in its tracks.

Justice Mackey’s decision Friday is just the latest legal blow for anti-vaccine parents and advocates. Judges in Kentucky and New York City have also recently struck down similar claims against various public health efforts to combat the spread of dangerous infectious diseases.