diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js
index b6725b1..ecc6042 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js
@@ -59,13 +59,10 @@
         AaiService.getHomingData(DataService.getVnfInstanceId(), DataService.getVfModuleInstanceId())
             .then(function (res) {
                 if (res && res.data) {
-                    $scope.regionSelection = {
-                        optionId: (res.data[COMPONENT.CLOUD_REGION_ID]) ? res.data[COMPONENT.CLOUD_REGION_ID] : null,
-                        legacyRegion: null,
-                        tenant: (res.data[COMPONENT.TENANT_ID]) ? res.data[COMPONENT.TENANT_ID] : null
-                    };
-                    $scope.isHomingData = $scope.regionSelection.optionId !== null && res.data.tenant !== null;
-                    $scope.isHomingData = $scope.isHomingData && !$scope.selectedLcpRegionIsMegaRegion();
+                    $scope.regionSelection.optionId = (res.data.cloudRegionOptionId);
+                    $scope.regionSelection.tenant = (res.data[COMPONENT.TENANT_ID]) ? res.data[COMPONENT.TENANT_ID] : null;
+                    $scope.isHomingData = $scope.regionSelection.optionId !== null && $scope.regionSelection.tenant !== null;
+                    $scope.isHomingData = $scope.isHomingData && (($scope.megaRegion).indexOf(res.data[COMPONENT.CLOUD_REGION_ID]) === -1);
                 }
 
                 if (!$scope.isHomingData) {
@@ -145,9 +142,12 @@
     };
 
     $scope.selectedLcpRegionIsMegaRegion = function() {
-        let cloudRegionId =
-            DataService.getCloudOwnerAndLcpCloudRegionFromOptionId($scope.regionSelection.optionId).cloudRegionId;
-        return ($scope.megaRegion).indexOf(cloudRegionId) > -1
+        if ($scope.regionSelection.optionId) {
+            let cloudRegionId = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId($scope.regionSelection.optionId).cloudRegionId;
+            return ($scope.megaRegion).indexOf(cloudRegionId) > -1
+        } else {
+            return false;
+        }
     };
 
     $scope.cancel = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
index e940183..0d0fa6d 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
@@ -430,6 +430,7 @@
         },
         getLcpCloudRegionTenantList : function(globalCustomerId, serviceType,
                                                successCallbackFunction) {
+            let self = this;
             $log
                 .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: "
                     + globalCustomerId);
@@ -447,12 +448,12 @@
                 for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
                     var cloudOwner = aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER];
                     var cloudRegionId = aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID];
-                    var cloudRegionOptionId = 'option-' + cloudOwner + '-' + cloudRegionId;
+                    var cloudRegionOptionId = self.cloudRegionOptionId(cloudOwner, cloudRegionId);
 
                     lcpCloudRegionTenants.push({
                         "cloudOwner": cloudOwner,
                         "cloudRegionId": cloudRegionId,
-                        "cloudRegionOptionId": cloudRegionOptionId.toLowerCase(),
+                        "cloudRegionOptionId": cloudRegionOptionId,
                         "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
                         "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
                         "isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]});
@@ -760,7 +761,12 @@
                 });
         },
 
+        cloudRegionOptionId: function (cloudOwner, cloudRegionId) {
+            return ('option-' + cloudOwner + '-' + cloudRegionId).toLowerCase();
+        },
+
         getHomingData: function(vnfInstanceId, vfModuleId)  {
+            let self = this;
             var url = COMPONENT.AAI_GET_HOMING_DATA.replace('@vnfInstanceId', vnfInstanceId)
                 .replace('@vfModuleId', vfModuleId);
 
@@ -768,6 +774,14 @@
 
             $http.get(url)
                 .success(function (response) {
+                    var cloudOwner = response[COMPONENT.CLOUD_OWNER];
+                    var cloudRegionId = response[COMPONENT.CLOUD_REGION_ID];
+                    if (cloudOwner && cloudRegionId) {
+                        response["cloudRegionOptionId"] = self.cloudRegionOptionId(cloudOwner, cloudRegionId);
+                    } else {
+                        response["cloudRegionOptionId"] = null;
+                    }
+
                     deferred.resolve({data: response});
                 }).error(function (data, status, headers, config) {
                 deferred.reject({message: data, status: status});
