How tragedies at school can be prevented