Added patch for multithreaded client