Fix for listener error

Changes who emits the connection message to solve an issue with certain node verisons