error handling creating an event