fix a bug in quicksort