client/server thread bug fix