implemented keyhandler