fix randomized_partition index error