update logic for tree