Sort files before adding them to directory view