Fix the blocking thread issue.