Fix immediate exit when pressing escape