Hard to say what you could do to stop something like this. Maybe more cameras, better doors with remote locking controlled from where the cameras are being monitored. They could have locked things down after the first shooting. They could have seen him putting chains on the doors if they had cameras on exterior doors.