fixed a minor bug, medial order