fix eventhandler bug