changed the client function a bit