         {
             awm.removeEventListener("activatedForm", awm_activatedFormHandler);
             awm.removeEventListener("deactivatedForm", awm_deactivatedFormHandler);
+            awm.removeEventListener("removeFocusManager", awm_removeFocusManagerHandler);
         }
         
         if (stageText == null)

        {
            awm.addEventListener("activatedForm", awm_activatedFormHandler, false, 0, true);
            awm.addEventListener("deactivatedForm", awm_deactivatedFormHandler, false, 0, true);
        }
        
        if (stageText == null)

        updateProxyImageForForm(form);
    }
    
    private function awm_removeFocusManagerHandler(event:FocusEvent):void
    {
        // When a popup is removed from the popup manager, its focus manager
        // gets removed from the ActiveWindowManager. This happens even in cases
        // where the AWM will not send a deactivatedForm event for that popup.
        // This happens before the popup is removed from the AWM's forms array,
        // though, so the popup whose focus manager is getting removed needs to
        // be explicitly skipped when determining the new topmost form.
        var removedForm:Object = event.relatedObject;
        updateProxyImageForTopmostForm(removedForm);
    }
    
    private function stageText_changeHandler(event:Event):void
    {
        var foundChange:Boolean = false;
