fix bug in quicksort on linked list