Fixed the esc key quitting function.