Fix a data race in Client