add serialize and deserialize in the treenode