validation BUGFIX remove node from logging before being deleted
diff --git a/src/validation.c b/src/validation.c
index b9b8570..e4c51dd 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -605,12 +605,12 @@
             node->flags &= ~LYD_NEW;
         }
 
+        LOG_LOCBACK(node->schema ? 1 : 0, 1, 0, 0);
+
         if (node->flags & LYD_DEFAULT) {
             /* remove leftover default nodes from a no-longer existing case */
             lyd_validate_autodel_case_dflt(first, node, mod, &next, diff);
         }
-
-        LOG_LOCBACK(node->schema ? 1 : 0, 1, 0, 0);
     }
 
     return LY_SUCCESS;