fixed the traversal not writing to the nested object