finally fixed traversal