Fixed the thread issue.