fix quick sort bug