 
     private function portalItem_getJSONDataResultHandler(itemData:Object, item:PortalItem):void
     {
-        createBasemapLayerObject(itemData, item);
+        createBasemapLayerObjectFromWebMapItemAndData(item, itemData);
         if (isDefaultBasemap(itemData.baseMap))
         {
             defaultBasemapTitle = itemData.baseMap.title;

        {
            layerXML = createTiledLayerXML(title, iconURL, url, basemapLayerObject, false);
        }
        else if (isAllowedType(type))
        {
            layerXML = createNonEsriLayerXML(title, iconURL, basemapLayerObject, false, type);
        }

        updateTotalArcGISBasemaps();
    }

    private function createBasemapLayerObjectFromWebMapItemAndData(item:PortalItem, itemData:Object):void
    {
        if (!itemData)
        {
