bug fix for client.cpp