Added support for connect/error external listeners