Use ui.eventId rather than global eventIdNum