added support for custom listeners