fixed app crash when eventhandler is not available