Sortdata for with index fix