Add check of file status when assembling the list of files to fetch