Fixed import_files loop problem