add destructors in tree.c