Select Frame -- issue

I can’t select other frame, When I close last frame. IT show error The selected frame has been removed. You may want to use another selectFrame before its removal.