Added exit when escape is pressed.