fix event creation bug