Fixed the non-thread errors
Removed unused imports