fixed a bug in the event class