fix sort of index