added handler for key press