NEW YORK (AP) — The police agency that patrols New York City’s main bus terminal has agreed to stop sending plainclothes officers into its public bathrooms to try and catch people propositioning strangers for sex.

Activists have criticized those sting operations as a discriminatory relic of an era of crackdowns predominantly aimed at gay men. Under a legal settlement entered in federal court Tuesday, the Port Authority of New York and New Jersey will give its new police recruits LGBTQ+ sensitivity training for the next three years.

The settlement resolves a lawsuit brought by people who had been arrested as a result of the patrols by the Port Authority Police Department. Many had claimed that the charges were baseless.