added program termination for ESC key