diff --git a/bmc/version-handler/test/version_close_unittest.cpp b/bmc/version-handler/test/version_close_unittest.cpp
index 83b4a43..c529206 100644
--- a/bmc/version-handler/test/version_close_unittest.cpp
+++ b/bmc/version-handler/test/version_close_unittest.cpp
@@ -31,9 +31,8 @@
 TEST_F(VersionCloseExpireBlobTest, VerifyOpenThenClose)
 {
     EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
-    EXPECT_CALL(*tm.at("blob0"), status())
-        .WillOnce(Return(ActionStatus::success));
     EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
+    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->close(0));
 }
 
@@ -45,9 +44,8 @@
 TEST_F(VersionCloseExpireBlobTest, VerifyDoubleCloseFails)
 {
     EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
-    EXPECT_CALL(*tm.at("blob0"), status())
-        .WillOnce(Return(ActionStatus::success));
     EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
+    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->close(0));
     EXPECT_FALSE(h->close(0));
 }
@@ -55,20 +53,17 @@
 TEST_F(VersionCloseExpireBlobTest, VerifyBadSessionNumberCloseFails)
 {
     EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
-    EXPECT_CALL(*tm.at("blob0"), status())
-        .WillOnce(Return(ActionStatus::success));
     EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
     EXPECT_FALSE(h->close(1));
+    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->close(0));
 }
 
 TEST_F(VersionCloseExpireBlobTest, VerifyRunningActionIsAborted)
 {
     EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
-    EXPECT_CALL(*tm.at("blob0"), status())
-        .WillOnce(Return(ActionStatus::running));
-    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
+    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->close(0));
 }
 
diff --git a/bmc/version-handler/test/version_open_unittest.cpp b/bmc/version-handler/test/version_open_unittest.cpp
index 0e80a94..033b2f4 100644
--- a/bmc/version-handler/test/version_open_unittest.cpp
+++ b/bmc/version-handler/test/version_open_unittest.cpp
@@ -21,11 +21,6 @@
     {
         h = std::make_unique<VersionBlobHandler>(
             createMockVersionConfigs(blobNames, &im, &tm));
-        for (const auto& blob : blobNames)
-        {
-            EXPECT_CALL(*tm.at(blob), status())
-                .WillRepeatedly(Return(ActionStatus::unknown));
-        }
     }
 
     std::unique_ptr<blobs::GenericBlobInterface> h;
@@ -43,10 +38,10 @@
 
 TEST_F(VersionOpenBlobTest, VerifyMultipleBlobOpens)
 {
-    for (const auto& [key, val] : tm)
+    for (const auto& [_, val] : tm)
     {
         /* set the expectation that every onOpen will be triggered */
-        EXPECT_CALL(*val, trigger()).Times(1).WillOnce(Return(true));
+        EXPECT_CALL(*val, trigger()).WillOnce(Return(true));
     }
     int i{defaultSessionNumber};
     for (const auto& blob : blobNames)
@@ -57,37 +52,36 @@
 
 TEST_F(VersionOpenBlobTest, VerifyOpenAfterClose)
 {
-    EXPECT_CALL(*tm.at("blob0"), trigger())
-        .Times(2)
-        .WillRepeatedly(Return(true));
+    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
     EXPECT_TRUE(h->open(defaultSessionNumber, blobs::read, "blob0"));
+
+    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
     EXPECT_TRUE(h->close(defaultSessionNumber));
+
+    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
     EXPECT_TRUE(h->open(defaultSessionNumber, blobs::read, "blob0"));
 }
 
 TEST_F(VersionOpenBlobTest, VerifyDoubleOpenFails)
 {
-    EXPECT_CALL(*tm.at("blob1"), trigger())
-        .Times(1)
-        .WillRepeatedly(Return(true));
+    EXPECT_CALL(*tm.at("blob1"), trigger()).WillOnce(Return(true));
     EXPECT_TRUE(h->open(0, blobs::read, "blob1"));
     EXPECT_FALSE(h->open(2, blobs::read, "blob1"));
+    EXPECT_FALSE(h->open(2, blobs::read, "blob1"));
 }
 
 TEST_F(VersionOpenBlobTest, VerifyFailedTriggerFails)
 {
-    EXPECT_CALL(*tm.at("blob1"), trigger())
-        .Times(2)
-        .WillOnce(Return(false))
-        .WillOnce(Return(true));
+    EXPECT_CALL(*tm.at("blob1"), trigger()).WillOnce(Return(false));
     EXPECT_FALSE(h->open(0, blobs::read, "blob1"));
+    EXPECT_CALL(*tm.at("blob1"), trigger()).WillOnce(Return(true));
     EXPECT_TRUE(h->open(0, blobs::read, "blob1"));
 }
 
 TEST_F(VersionOpenBlobTest, VerifyUnsupportedOpenFlagsFails)
 {
-    EXPECT_CALL(*tm.at("blob1"), trigger()).Times(1).WillOnce(Return(true));
     EXPECT_FALSE(h->open(0, blobs::write, "blob1"));
+    EXPECT_CALL(*tm.at("blob1"), trigger()).WillOnce(Return(true));
     EXPECT_TRUE(h->open(0, blobs::read, "blob1"));
 }
 
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index 5d66713..9918e33 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -70,22 +70,20 @@
     }
 
     auto& v = *blobInfoMap.at(path);
-    sessionToBlob[session] = &v;
-
     if (v.blobState == blobs::StateFlags::open_read)
     {
         fprintf(stderr, "open %s fail: blob already opened for read\n",
                 path.c_str());
-        cleanup(session);
         return false;
     }
     if (v.actions->onOpen->trigger() == false)
     {
         fprintf(stderr, "open %s fail: onOpen trigger failed\n", path.c_str());
-        cleanup(session);
         return false;
     }
+
     v.blobState = blobs::StateFlags::open_read;
+    sessionToBlob[session] = &v;
     return true;
 }
 
@@ -147,10 +145,7 @@
     try
     {
         auto& pack = *sessionToBlob.at(session);
-        if (pack.actions->onOpen->status() == ActionStatus::running)
-        {
-            pack.actions->onOpen->abort();
-        }
+        pack.actions->onOpen->abort();
         pack.blobState = static_cast<blobs::StateFlags>(0);
         sessionToBlob.erase(session);
         return true;
