Fix thread issue.