added keyhandler to replace user_interaction