Added the EventDispatcher code