Solving thread issues.