optimize addChild for tree. Update #341