Fixed bug when adding new event.