ASHEVILLE, N.C. (AP) — A federal judge won’t allow North Carolina legislative leaders and some state magistrates for now to become defendants in a lawsuit seeking to overturn a state law allowing magistrates to refuse officiate at gay marriages because of religious beliefs.

U.S. District Judge Max Cogburn agreed Friday with the earlier ruling of a federal magistrate judge. They both rejected arguments by House Speaker Tim Moore, Senate leader Phil Berger and others that Attorney General Roy Cooper isn’t adequately defending the law.

Cooper personally opposes the law, which when used requires state magistrates to avoid presiding at all marriages for at least six months.

Cogburn hasn’t yet ruled on a motion to dismiss the lawsuit. The plaintiffs say no taxpayer money should go toward someone who fails to carry out sworn duties.