Sorting file list to avoid issues