preorder traversal not working