refactored file import, fixed concurrency problems