fixed thread management in client