diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
old mode 100644
new mode 100755
index 18fffc911e4dfb5f68d343e07749e00abb8f5ea9..7537f2033f1cb10c132b48efde1dc08da217363a
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -508,7 +508,13 @@ static uint8_t target_extruder;
 #endif
 
 #if ENABLED(Z_DUAL_ENDSTOPS)
-  float z_endstop_adj = 0;
+  float z_endstop_adj =
+    #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
+      Z_DUAL_ENDSTOPS_ADJUSTMENT
+    #else
+      0
+    #endif
+  ;
 #endif
 
 // Extruder offsets
@@ -2281,7 +2287,7 @@ static void clean_up_after_endstop_or_probe_move() {
         if (enable) planner.unapply_leveling(current_position);
       }
 
-    #elif HAS_ABL
+    #elif HAS_ABL && !ENABLED(AUTO_BED_LEVELING_UBL)
 
       #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
         const bool can_change = (!enable || (bilinear_grid_spacing[0] && bilinear_grid_spacing[1]));
@@ -2302,7 +2308,11 @@ static void clean_up_after_endstop_or_probe_move() {
         else
           planner.unapply_leveling(current_position);
       }
-
+    #elif ENABLED(AUTO_BED_LEVELING_UBL)
+      if (blm.state.EEPROM_storage_slot == 0)  {
+        blm.state.active = enable;
+        blm.store_state();
+      }  
     #endif
   }
 
@@ -7139,6 +7149,8 @@ void quickstop_stepper() {
     const bool new_status =
       #if ENABLED(MESH_BED_LEVELING)
         mbl.active()
+      #elif ENABLED(AUTO_BED_LEVELING_UBL)
+        blm.state.active
       #else
         planner.abl_enabled
       #endif
diff --git a/Marlin/enum.h b/Marlin/enum.h
old mode 100644
new mode 100755
index 9175696a5b7bc366fe54cc0a2fb985cb3389378f..70d72564886f95bb99b0e47e3ef769d5217cc2f0
--- a/Marlin/enum.h
+++ b/Marlin/enum.h
@@ -75,6 +75,7 @@ enum DebugFlags {
   DEBUG_DRYRUN        = _BV(3), ///< Ignore temperature setting and E movement commands
   DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
   DEBUG_LEVELING      = _BV(5), ///< Print detailed output for homing and leveling
+  DEBUG_MESH_ADJUST   = _BV(6), ///< UBL bed leveling
   DEBUG_ALL           = 0xFF
 };