Implemented the connect of the client