Added support for event listeners.