Correct of ending of client thread.