Massachusetts Gov. Charlie Baker signed new legislation that will allow anyone in the commonwealth to use bathrooms or locker rooms that match their gender identity, and empowers authorities to make sure that no one does so fraudulently.

How that will be accomplished is unclear, however. Opponents had complained that male sexual predators could pretend to be transgender women and enter women’s locker rooms. But legislators and LGBTQ advocacy groups say those concerns are unfounded. Not once has there been such an incident in any one of the nearly 20 states that already have public accommodations protections for transgender people.

The bill signed into law addresses the issue by combining two previous versions that passed both chambers of the commonwealth government.

“This compromise legislation extends additional protections to the commonwealth’s transgender community, and includes language to address the public safety concerns expressed by some by requiring the attorney general to issue regulations to protect against people abusing the law,” Baker said in a statement.

The version signed by the governor will require the Massachusetts Commission Against Discrimination to create guidelines for businesses to follow in complying with the law, and instructs the attorney general to draw up policies and recommendations for law enforcement to deal with anyone who claims gender identity for an “improper purpose.”

Time is short for the AG to come up with those recommended regulations, which are due by Sept. 1. The law goes into effect Oct. 1.

LGBTQ advocates heralded the passage of the Massachusetts bill, given how other states have tried to enact restrictions. North Carolina instituted a law earlier this year that mandates people use only the restrooms that correspond to the gender on their birth certificates.

Also Friday, ten states sued the federal government over guidance that public schools must allow transgender students to use restrooms conforming to their gender identity, joining a dozen other states and governors opposed to the federal recommendations.

The lawsuit, filed in federal court in Nebraska, also includes Arkansas, Kansas, Michigan, Montana, North Dakota, Ohio, South Carolina, South Dakota and Wyoming.