update tree structure