added support for event listeners