onEventSelect undefined event bug fix