diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index 7cc0194..14d405f 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -239,22 +239,24 @@
             }
             else if (itr.value().is_string())
             {
-                if constexpr (is_same<T, Parsed>::value)
+                if (busProp == "LocationCode" && inf == IBM_LOCATION_CODE_INF)
                 {
-                    if (busProp == "LocationCode" &&
-                        inf == IBM_LOCATION_CODE_INF)
+                    std::string prop;
+                    if constexpr (is_same<T, Parsed>::value)
                     {
                         // TODO deprecate the com.ibm interface later
-                        auto prop = expandLocationCode(
-                            itr.value().get<string>(), vpdMap, isSystemVpd);
-                        props.emplace(busProp, prop);
-                        interfaces.emplace(XYZ_LOCATION_CODE_INF, props);
-                        interfaces.emplace(IBM_LOCATION_CODE_INF, props);
+                        prop = expandLocationCode(itr.value().get<string>(),
+                                                  vpdMap, isSystemVpd);
                     }
-                    else
+                    else if constexpr (is_same<T, KeywordVpdMap>::value)
                     {
-                        props.emplace(busProp, itr.value().get<string>());
+                        // Send empty Parsed object to expandLocationCode api.
+                        prop = expandLocationCode(itr.value().get<string>(),
+                                                  Parsed{}, false);
                     }
+                    props.emplace(busProp, prop);
+                    interfaces.emplace(XYZ_LOCATION_CODE_INF, props);
+                    interfaces.emplace(IBM_LOCATION_CODE_INF, props);
                 }
                 else
                 {
@@ -1442,4 +1444,4 @@
     }
 
     return rc;
-}
\ No newline at end of file
+}
