added handlers for key press