fix the logic for adding the filename column in multiple-file mode