fixed bug where buffer files were not sorted when building index