fix #6980, method sorting bug