Fixing Out of thread errors.