Legislation makes schools safer