Replaced for loop in event_id check