A federal judge in California on Wednesday ordered the U.S. Environmental Protection Agency (EPA) to strengthen its rules around fluoride in drinking water, writing that the compound could pose a risk to children’s intellectual development.

In August, the federal National Toxicology Program found that there is a link between higher amounts of fluoride exposure and a lower IQ in children, potentially upending the longstanding practice of adding it to tap water to prevent tooth decay. The agency based its conclusion on studies involving fluoride levels at about twice the recommended limit for drinking water. On Tuesday, Chen sided with several advocacy groups that filed a lawsuit against the EPA, which had argued that it wasn’t clear what effect fluoride exposure might have at lower levels.

However, the federal agency is required to make sure there is a margin between the hazard level and exposure level. And “if there is an insufficient margin, then the chemical poses a risk,” Chen wrote. “Simply put, the risk to health at exposure levels in United States drinking water is sufficiently high to trigger regulatory response by the EPA” under federal law, he said.

Chen said that “scientific literature in the record provides a high level of certainty that a hazard is present” and “fluoride is associated with reduced IQ.” He stressed that his ruling does not stipulate that fluoridated water can cause lower IQ in children with certainty but is only weighing the pot.