test CHANGE enhance schema tests
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 6657702..fb712bc 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -164,6 +164,8 @@
             ++inc->submodule->refcount;
             free(submod);
         }
+    } else {
+        ++inc->submodule->refcount;
     }
     if (!inc->submodule) {
         if (ly_errcode(ctx->ctx) != LY_EVALID) {