If a person poses an imminent threat of a great enough magnitude, their murder is justified. Of course, less drastic measures should first be considered, but there is nothing wrong with killing a person if that is the safest way to prevent them from committing a horrible act.