fix bug in quicksort