     func popAllModules(animated: Bool) {
         MXLog.debug("[NavigationRouter] Pop all modules")
         
-        let controllersToPop = self.navigationController.viewControllers
+        let controllersToPop = self.navigationController.viewControllers.reversed()
         
         controllersToPop.forEach {
             self.willPopViewController($0)

        
        self.addModule(module, for: controller)
        
        let controllersToPop = self.navigationController.viewControllers
        
        controllersToPop.forEach {
            self.willPopViewController($0)

        if controllers.count > 1 {
            let controllersToPop = controllers[1..<controllers.count]
            
            controllersToPop.reversed().forEach {
                self.willPopViewController($0)
            }
        }
        
        if let controllers = navigationController.popToRootViewController(animated: animated) {
            controllers.reversed().forEach {
                self.didPopViewController($0)
            }
        }
