removed unused imports
Added a thread for auto refresh