Changed use of sortContents in fetchFiles Function