complete getEvent function