lfs.dir does not necessarily sort, so we need to sort to process the correct order