diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index df8473f..c2f76f9 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -235,6 +235,20 @@
                         std::pair<std::string, std::vector<std::string>>>
                         &connections = obj.second;
 
+                    // if can't parse fw id then return
+                    std::size_t idPos = obj.first.rfind("/");
+                    if (idPos == std::string::npos ||
+                        idPos + 1 == obj.first.size())
+                    {
+                        asyncResp->res.result(
+                            boost::beast::http::status::internal_server_error);
+                        asyncResp->res.jsonValue = messages::internalError();
+                        BMCWEB_LOG_DEBUG << "Can't parse firmware ID!!";
+                        return;
+                    }
+
+                    std::string swId = obj.first.substr(idPos + 1);
+
                     for (auto &conn : connections)
                     {
                         const std::string &connectionName = conn.first;
@@ -243,9 +257,9 @@
                         BMCWEB_LOG_DEBUG << "obj.first = " << obj.first;
 
                         crow::connections::systemBus->async_method_call(
-                            [asyncResp](
-                                const boost::system::error_code error_code,
-                                const VariantType &activation) {
+                            [asyncResp,
+                             swId](const boost::system::error_code error_code,
+                                   const VariantType &activation) {
                                 BMCWEB_LOG_DEBUG
                                     << "safe returned in lambda function";
                                 if (error_code)
@@ -256,31 +270,33 @@
                                     return;
                                 }
 
-                                const std::string *swInvPurpose =
+                                const std::string *swActivationStatus =
                                     mapbox::getPtr<const std::string>(
                                         activation);
-                                if (swInvPurpose == nullptr)
+                                if (swActivationStatus == nullptr)
                                 {
                                     asyncResp->res.result(
                                         boost::beast::http::status::
                                             internal_server_error);
                                     return;
                                 }
-                                std::size_t last_pos = swInvPurpose->rfind(".");
-                                if (last_pos == std::string::npos)
+                                if (swActivationStatus != nullptr &&
+                                    *swActivationStatus !=
+                                        "xyz.openbmc_project.Software."
+                                        "Activation."
+                                        "Activations.Active")
                                 {
-                                    asyncResp->res.result(
-                                        boost::beast::http::status::
-                                            internal_server_error);
+                                    // The activation status of this software is
+                                    // not currently active, so does not need to
+                                    // be listed in the response
                                     return;
                                 }
                                 nlohmann::json &members =
                                     asyncResp->res.jsonValue["Members"];
                                 members.push_back(
-                                    {{"@odata.id",
-                                      "/redfish/v1/UpdateService/"
-                                      "FirmwareInventory/" +
-                                          swInvPurpose->substr(last_pos + 1)}});
+                                    {{"@odata.id", "/redfish/v1/UpdateService/"
+                                                   "FirmwareInventory/" +
+                                                       swId}});
                                 asyncResp->res
                                     .jsonValue["Members@odata.count"] =
                                     members.size();
@@ -374,7 +390,7 @@
                         continue;
                     }
 
-                    if (obj.second.size() <= 1)
+                    if (obj.second.size() < 1)
                     {
                         continue;
                     }
@@ -417,35 +433,33 @@
 
                             BMCWEB_LOG_DEBUG << "swInvPurpose = "
                                              << *swInvPurpose;
-                            if (boost::ends_with(*swInvPurpose, "." + *swId))
+                            it = propertiesList.find("Version");
+                            if (it == propertiesList.end())
                             {
-                                it = propertiesList.find("Version");
-                                if (it == propertiesList.end())
-                                {
-                                    BMCWEB_LOG_DEBUG
-                                        << "Can't find property \"Version\"!";
-                                    asyncResp->res.result(
-                                        boost::beast::http::status::
-                                            internal_server_error);
-                                    return;
-                                }
-
-                                const std::string *version =
-                                    mapbox::getPtr<const std::string>(
-                                        it->second);
-
-                                if (version != nullptr)
-                                {
-                                    BMCWEB_LOG_DEBUG
-                                        << "Can't find property \"Version\"!";
-                                    asyncResp->res.result(
-                                        boost::beast::http::status::
-                                            internal_server_error);
-                                    return;
-                                }
-                                asyncResp->res.jsonValue["Version"] = *version;
-                                asyncResp->res.jsonValue["Id"] = *swId;
+                                BMCWEB_LOG_DEBUG
+                                    << "Can't find property \"Version\"!";
+                                asyncResp->res.result(
+                                    boost::beast::http::status::
+                                        internal_server_error);
+                                return;
                             }
+
+                            BMCWEB_LOG_DEBUG << "Version found!";
+
+                            const std::string *version =
+                                mapbox::getPtr<const std::string>(it->second);
+
+                            if (version == nullptr)
+                            {
+                                BMCWEB_LOG_DEBUG
+                                    << "Can't find property \"Version\"!";
+                                asyncResp->res.result(
+                                    boost::beast::http::status::
+                                        internal_server_error);
+                                return;
+                            }
+                            asyncResp->res.jsonValue["Version"] = *version;
+                            asyncResp->res.jsonValue["Id"] = *swId;
                         },
                         obj.second[0].first, obj.first,
                         "org.freedesktop.DBus.Properties", "GetAll",
