fix traversal order