Updated create event function