Fixed how the sockets are listening for messages