Code Fix for threading issues.