A federal judge on Friday upheld a New Jersey law which bans “ex-gay” therapy to minors.

New Jersey in August became the second state after California to prohibit so-called conversion therapy that attempts to turn gay teens straight.

Republican Governor Chris Christie said in signing the law that he does not believe being gay is a choice and that such therapies expose children to health risks.

Two groups which promote such therapies, the National Association for Research and Therapy of Homosexuality (NARTH) and the American Association of Christian Counselors, sued the state, arguing that the law infringes on parents rights to “direct the upbringing and education of their children according to their sincerely held religious beliefs.”

Judge Freda L. Wolfson disagreed.

Wolfson wrote in her ruling that the law does not violate free speech or religious protection.

Similar legislation has been filed in several states, including New York, Pennsylvania and Ohio.