before adding scan_file_by_file