         if (!popUpData || popUpData.owner || popUpData.parent)
             throw new Error();              // not popUpData for a modal window
                     
-        hideModalWindow(popUpData, request.remove);
+        hideModalWindow(popUpData, request.data.remove);
         
         // handle removing popup window 
-        if (request.remove)
+        if (request.data.remove)
         {
             popupInfo.splice(popupInfo.indexOf(popUpData), 1);
             sm.numModalWindows--;

            {
                if (systemManager != sbRoot)
                {
                    request = new SandboxRootRequest(SandboxRootRequest.SYSTEM_MANAGER_REQUEST, false, false,
                                            "getVisibleApplicationRect"); 
                    sbRoot.dispatchEvent(request);
                    rect = Rectangle(request.value);

		// is hosting the popup.
		if (!sm.isTopLevelRoot() && sbRoot && sm == sbRoot)
		{
			request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, false, false, null, { window: DisplayObject(window)});
			request.requestor = sm.swfBridgeGroup.parentBridge;
			request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(window));
			sm.dispatchEvent(request);
		} 
		
