Intelligently kill the program