modified client.c to fix bug