Program closes if Escape is pressed