added tree.write() to save changes