keyhandler fix + cleanup