filter the list of files before sorting