The Minnesota Senate has approved a measure raising the bar for when sex offenders and people with mental illness can be released into communities.

The legislation sponsored by Sen. Warren Limmer, a Republican from Maple Grove, easily cleared the Senate Monday.

It’s in response to a court decision earlier this year that allowed the discharge of Kirk Fugelseth, a 51-year-old man who admitted abusing 31 children. The court ruled he no longer needed inpatient treatment.

The Department of Human Services says 21 sex offenders are living outside of state facilities on conditional release, which includes ankle location monitoring and other requirements.

The House is considering a similar bill.