Fixed race condition in HttpClient