diff --git a/storagehandler.cpp b/storagehandler.cpp
index 65497b2..0a46b83 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -38,7 +38,6 @@
 void register_netfn_storage_functions() __attribute__((constructor));
 
 unsigned int g_sel_time = 0xFFFFFFFF;
-extern unsigned short g_sel_reserve;
 extern const ipmi::sensor::IdInfoMap sensors;
 extern const FruMap frus;
 
@@ -161,7 +160,7 @@
 
     if (requestData->reservationID != 0)
     {
-        if (g_sel_reserve != requestData->reservationID)
+        if (!checkSELReservation(requestData->reservationID))
         {
             *data_len = 0;
             return IPMI_CC_INVALID_RESERVATION_ID;
@@ -275,12 +274,16 @@
     auto requestData =
         reinterpret_cast<const ipmi::sel::DeleteSELEntryRequest*>(request);
 
-    if (g_sel_reserve != requestData->reservationID)
+    if (!checkSELReservation(requestData->reservationID))
     {
         *data_len = 0;
         return IPMI_CC_INVALID_RESERVATION_ID;
     }
 
+    // Per the IPMI spec, need to cancel the reservation when a SEL entry is
+    // deleted
+    cancelSELReservation();
+
     try
     {
         ipmi::sel::readLoggingObjectPaths(cache::paths);
@@ -368,7 +371,7 @@
     auto requestData =
         reinterpret_cast<const ipmi::sel::ClearSELRequest*>(request);
 
-    if (g_sel_reserve != requestData->reservationID)
+    if (!checkSELReservation(requestData->reservationID))
     {
         *data_len = 0;
         return IPMI_CC_INVALID_RESERVATION_ID;
@@ -394,6 +397,9 @@
         return IPMI_CC_OK;
     }
 
+    // Per the IPMI spec, need to cancel any reservation when the SEL is cleared
+    cancelSELReservation();
+
     sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
     ipmi::sel::ObjectPaths objectPaths;
     auto depth = 0;
@@ -581,16 +587,12 @@
                                     ipmi_context_t context)
 {
     ipmi_ret_t rc = IPMI_CC_OK;
+    unsigned short selResID = reserveSel();
 
-    // IPMI spec, Reservation ID, the value simply increases against each
-    // execution of reserve_sel command.
-    if (++g_sel_reserve == 0)
-        g_sel_reserve = 1;
-
-    *data_len = sizeof(g_sel_reserve);
+    *data_len = sizeof(selResID);
 
     // Pack the actual response
-    std::memcpy(response, &g_sel_reserve, *data_len);
+    std::memcpy(response, &selResID, *data_len);
 
     return rc;
 }
@@ -606,9 +608,13 @@
     ipmi_add_sel_request_t* p = (ipmi_add_sel_request_t*)request;
     uint16_t recordid;
 
+    // Per the IPMI spec, need to cancel the reservation when a SEL entry is
+    // added
+    cancelSELReservation();
+
     recordid = ((uint16_t)p->eventdata[1] << 8) | p->eventdata[2];
 
-    *data_len = sizeof(g_sel_reserve);
+    *data_len = sizeof(recordid);
 
     // Pack the actual response
     std::memcpy(response, &p->eventdata[1], 2);
