     }
 
     func reloadCatagoryDataInBckgMode(afterRestoringScene: Bool) {
+        // Get current top view controllers
+        let viewControllers = UIApplication.shared.topViewControllers()
+        
         // Do not present HUD during re-login unless when restoring scenes
         hudViewController = afterRestoringScene ? UIApplication.shared.topViewControllers().first : nil
 

                            let vc = viewController as? FavoritesImagesViewController
                            vc?.reloadImages() {
                                // Close HUD if needed
                                self.hudViewController?.hidePiwigoHUD { }
                                // Resume uploads
                                let appDelegate = UIApplication.shared.delegate as? AppDelegate
                                appDelegate?.resumeAll()
                            }
                        }
                    }

                            let vc = viewController as? TaggedImagesViewController
                            vc?.reloadImages() {
                                // Close HUD if needed
                                self.hudViewController?.hidePiwigoHUD {
                                   // Resume uploads
                                   appDelegate?.resumeAll()
                               }
                            }
                        }
                        else if viewController is FavoritesImagesViewController, !NetworkVars.hasGuestRights,
