fixed a problem in the quicksort algorithm