Fixed bug in EventManager