Indiana Gov. Mike Pence has approved changes to new law that sparked boycotts of the state amid fears that it would allow discrimination against lesbians and gays.

Pence had asked lawmakers to clarify language in the religious objections law earlier this week as businesses canceled conventions and governments banned travel to the state. The House and Senate approved the changes Thursday after intense negotiations with business and community leaders, and Pence signed it late in the day.

The revised legislation prohibits providers from using the law as a legal defense for refusing to provide services, goods, facilities or accommodations. It also bars discrimination based on factors that include race, religion, disability, sexual orientation, gender identity or United States military service.

The law will take effect July 1.