fix sorting index list