minor changes in EventDispatcher to handle removing all listeners