fixed some traversal bugs