Fixing query: duplicated file encountered