A federal judge has ruled New York City schools now have the right to ban unvaccinated kids from attending classes when another student has a disease that could be otherwise preventable by vaccines.

This new law is in response to a pending suit by a few New York City residents who sued schools for denying their children from attending classes. Judge William F. Kuntz II of Federal District Court in Brooklyn ruled against the three families who said their right to exercise their religion was violated, The New York Times reported. Judge Kuntz wrote in his ruling that the Supreme Court has “strongly suggested that religious objectors are not constitutionally exempt from vaccinations.” The judged backed up his decision with a 1905 Supreme Court ruling that upheld a fine for a man living in Massachusetts after he refused to get a vaccine during a smallpox outbreak.

In New York State, the law requires that children are to get vaccinated before they attend school, unless their parents can show religious beliefs or medical reasons as to why the vaccines will harm the child. Parents who deny vaccines based on religious beliefs do not have to show proof of their religious affiliation, but they do have to provide the school with a written explanation. The school can accept or reject their claim.

One of the plaintiffs in the suit, Dina Check, said that the city had denied her 7-year-old daughter a religious exemption without going through the proper protocol. She said the city rejected her religious exemption after it had rejected her medical exemption. Check said the school nurse had accidently submitted a medical exemption without her consent.

“Disease is pestilence,” Check said, “and pestilence is from the Devil. The Devil is germs and disease, which is cancer and any of those things that can take you down. But if you trust in the Lord, these things cannot come near you.” Check came to this conclusion after a particularly rough pregnancy. She also claims her daughter was “intoxicated” by some of her vaccinations during pregnancy, which led to her daughter’s milk allergies, rashes, and infections.

The other two families said their religious liberties were hindered after their children were not allowed in schools when other students had chicken pox. Their First Amendment right to religious freedom and their 14th Amendment right to equal protection under the law were both violated, they claimed.

Recently there have been abnormal outbreaks in diseases that were practically a thing of the past. According to the Centers for Disease Control and Prevention, there have been 514 case and 16 outbreaks this year in the United States.