added support for multiple listeners on the same page