added to client.c and server.c