added control flow to event controller to prevent creating events that have passed