Updated to correctly connect to the server