Listening to the correct 'connect' event