fix append subtree functionality