fixed eventhandler bug