Added onConnect event to listener