tree schema BUGFIX handle augments properly
diff --git a/src/resolve.c b/src/resolve.c
index 15ce96f..3e0d90a 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -3467,7 +3467,7 @@
 
     /* check identifier uniqueness as in lys_node_addchild() */
     LY_TREE_FOR(aug->child, sub) {
-        if (lys_check_id(sub, aug->parent, lys_main_module(aug->module))) {
+        if (lys_check_id(sub, aug->target, NULL)) {
             return -1;
         }
     }