fixed a bug of HeapSort