updated client.cpp