NEW YORK (AP) — A federal appeals court ruled Friday against a group of New York parents who sued after the state made it more difficult for children to get a medical exemption from school immunization requirements, which were tightened after a major measles outbreak in 2019.

The 2nd U.S. Circuit Court of Appeals affirmed a lower court’s dismissal of a lawsuit filed by families and Children’s Health Defense, Robert F. Kennedy Jr.’s anti-vaccine group.

The lawsuit challenged state rules adopted in 2019 that did away with religious exemptions for vaccines and narrowed eligibility for medical exemptions down to children with just a few rare conditions, like severe allergic reactions to a previous dose of vaccine or certain, severe immune system diseases. The state’s allowed exemptions follow guidelines from a federal advisory panel.

The families argued the regulations violated their rights because school officials could deny requests on behalf of vulnerable children even when a doctor certified a medical need for an exemption.