tree data BUGFIX support for ext data
diff --git a/src/diff.c b/src/diff.c
index a283e2a..4ff4935 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -26,6 +26,7 @@
 #include "compat.h"
 #include "context.h"
 #include "log.h"
+#include "plugins_exts.h"
 #include "plugins_types.h"
 #include "set.h"
 #include "tree.h"
@@ -1076,7 +1077,11 @@
         /* insert it at the end */
         ret = 0;
         if (parent_node) {
-            ret = lyd_insert_child(parent_node, match);
+            if (match->flags & LYD_EXT) {
+                ret = lyd_insert_ext(parent_node, match);
+            } else {
+                ret = lyd_insert_child(parent_node, match);
+            }
         } else {
             ret = lyd_insert_sibling(*first_node, match, first_node);
         }