Fixed an issue with socket.on in the login phase