         VCs.removeFirst()
       }
       self.AM_testViewControllers = nil
+      for VC in VCs {
+        VC.removeFromParentViewController()
+      }
       return VCs
     }
     

    if let VCs = self.AM_testViewControllers {
      let newVCs = VCs + [viewController]
      self.AM_testViewControllers = newVCs
    }
  }
    
  func AM_testPopViewControllerAnimated(animated: Bool) -> UIViewController? {
    if var VCs = self.AM_testViewControllers {
      let poppedVC = VCs.removeLast()
      self.AM_testViewControllers = VCs
      return poppedVC
    }

          foundVC = true
          
        } else {
          let poppedVC = VCs.removeLast()
          poppedVC.removeFromParentViewController()
          poppedVCs.append(poppedVC)
        }
      }
      
