Fixed bug so that script reacts when user hits ESC