added update_client function