fix deleteEventById crash