fixed client thread bug