Correct thread bug