diff --git a/thresholds.hpp b/thresholds.hpp
index 1860d7c..be238a1 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -120,18 +120,24 @@
     /** @brief Set value of WarningHigh */
     virtual double warningHigh(double value)
     {
-        // persistThreshold
-        setDbusProperty(bus, entityManagerBusName, entityPath,
-                        entityInterfaceHigh, "Value", value);
+        if (!entityPath.empty() && !entityInterfaceHigh.empty())
+        {
+            // persistThreshold
+            setDbusProperty(bus, entityManagerBusName, entityPath,
+                            entityInterfaceHigh, "Value", value);
+        }
         return WarningObject::warningHigh(value);
     }
 
     /** @brief Set value of WarningLow */
     virtual double warningLow(double value)
     {
-        // persistThreshold
-        setDbusProperty(bus, entityManagerBusName, entityPath,
-                        entityInterfaceLow, "Value", value);
+        if (!entityPath.empty() && !entityInterfaceLow.empty())
+        {
+            // persistThreshold
+            setDbusProperty(bus, entityManagerBusName, entityPath,
+                            entityInterfaceLow, "Value", value);
+        }
         return WarningObject::warningLow(value);
     }
 
@@ -234,16 +240,22 @@
     virtual double criticalHigh(double value)
     {
         // persistThreshold
-        setDbusProperty(bus, entityManagerBusName, entityPath,
-                        entityInterfaceHigh, "Value", value);
+        if (!entityPath.empty() && !entityInterfaceHigh.empty())
+        {
+            setDbusProperty(bus, entityManagerBusName, entityPath,
+                            entityInterfaceHigh, "Value", value);
+        }
         return CriticalObject::criticalHigh(value);
     }
 
     /** @brief Set value of CriticalLow */
     virtual double criticalLow(double value)
     {
-        setDbusProperty(bus, entityManagerBusName, entityPath,
-                        entityInterfaceLow, "Value", value);
+        if (!entityPath.empty() && !entityInterfaceLow.empty())
+        {
+            setDbusProperty(bus, entityManagerBusName, entityPath,
+                            entityInterfaceLow, "Value", value);
+        }
         return CriticalObject::criticalLow(value);
     }
 
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index d130200..e2e0399 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -596,15 +596,6 @@
         criticalIface =
             std::make_unique<Threshold<CriticalObject>>(bus, objPath.c_str());
 
-        criticalIface->criticalHigh(threshold.value(
-            "CriticalHigh", std::numeric_limits<double>::quiet_NaN()));
-        criticalIface->criticalLow(threshold.value(
-            "CriticalLow", std::numeric_limits<double>::quiet_NaN()));
-        criticalIface->setHighHysteresis(
-            threshold.value("CriticalHighHysteresis", defaultHysteresis));
-        criticalIface->setLowHysteresis(
-            threshold.value("CriticalLowHysteresis", defaultHysteresis));
-
         if (threshold.contains("CriticalHigh"))
         {
             criticalIface->setEntityInterfaceHigh(
@@ -632,6 +623,15 @@
             debug("Sensor Threshold:{NAME} = path:{PATH}", "NAME", objPath,
                   "PATH", entityPath);
         }
+
+        criticalIface->criticalHigh(threshold.value(
+            "CriticalHigh", std::numeric_limits<double>::quiet_NaN()));
+        criticalIface->criticalLow(threshold.value(
+            "CriticalLow", std::numeric_limits<double>::quiet_NaN()));
+        criticalIface->setHighHysteresis(
+            threshold.value("CriticalHighHysteresis", defaultHysteresis));
+        criticalIface->setLowHysteresis(
+            threshold.value("CriticalLowHysteresis", defaultHysteresis));
     }
 
     if (threshold.contains("WarningHigh") || threshold.contains("WarningLow"))
@@ -639,15 +639,6 @@
         warningIface =
             std::make_unique<Threshold<WarningObject>>(bus, objPath.c_str());
 
-        warningIface->warningHigh(threshold.value(
-            "WarningHigh", std::numeric_limits<double>::quiet_NaN()));
-        warningIface->warningLow(threshold.value(
-            "WarningLow", std::numeric_limits<double>::quiet_NaN()));
-        warningIface->setHighHysteresis(
-            threshold.value("WarningHighHysteresis", defaultHysteresis));
-        warningIface->setLowHysteresis(
-            threshold.value("WarningLowHysteresis", defaultHysteresis));
-
         if (threshold.contains("WarningHigh"))
         {
             warningIface->setEntityInterfaceHigh(
@@ -675,6 +666,15 @@
             debug("Sensor Threshold:{NAME} = path:{PATH}", "NAME", objPath,
                   "PATH", entityPath);
         }
+
+        warningIface->warningHigh(threshold.value(
+            "WarningHigh", std::numeric_limits<double>::quiet_NaN()));
+        warningIface->warningLow(threshold.value(
+            "WarningLow", std::numeric_limits<double>::quiet_NaN()));
+        warningIface->setHighHysteresis(
+            threshold.value("WarningHighHysteresis", defaultHysteresis));
+        warningIface->setLowHysteresis(
+            threshold.value("WarningLowHysteresis", defaultHysteresis));
     }
 
     if (threshold.contains("HardShutdownHigh") ||
