 
     @objc func buttonCloseDidPressed(_ sender: Any) {
         dismiss(animated: true, completion: nil)
-        AppManager.changeSelectedServer(index: (DatabaseManager.servers?.count ?? 1) - 1)
-        AppManager.reloadApp()
+        AppManager.changeSelectedServer(index: selectedServer)
     }
 
     func connect() {

            navigationItem.leftBarButtonItem = buttonClose
        }

        infoRequestHandler.delegate = self
        textFieldServerURL.placeholder = defaultURL


    internal let buttonConnectBottomSpacing: CGFloat = 24

    var deepLinkCredentials: DeepLinkCredentials?
    var selectedServer: Int = 0

    var shouldAutoConnect = false
    var url: URL? {
