bug fix in traversal