fix #4675, method sorting bug