fix incomplete pattern for traversal