resolve a thread bug