Two New York teachers lost their bid Tuesday to recover union fees they had unwillingly paid before the U.S. Supreme Court’s landmark Janus ruling, which put an end to the requirement that private-sector employees who opt out of union membership still pay into collective-bargaining efforts.

The ruling, from a three-judge panel of the U.S. Court of Appeals for the Second Circuit, found that the union, New York State United Teachers, was not required to return agency fees it had collected from nonmembers under pre-Janus controlling high court precedent and valid state statutes.