change save_tree function elements