add function in client.c