adding modified flag to subtree