fix thread bug...