Fix bug when create an event