Make file scan threaded
Fix threading