                 break
             }
             
-            switch finalResult {
+            switch result {
             case .response(let response)?:
                 return response
             case .error(let error)?:

            
            controller.load(
                urlRequest: urlRequest,
                onResult: { [weak self] result in
                    guard let strongSelf = self else { return }
                    
                    do {
                        let handledResult = try strongSelf.handle(
                            result: result,
                            fails: fails,
                            originalPath: originalPath
                        )
                        
                        switch handledResult {
                        case let .response(value):
                            finalResult = .response(value)
                        case .fail:
                            fails += 1
                            strongSelf.currentController?.reload()
                        case .nothing:
                            break
                        }
                        
                    }
                    catch let error {
                        finalResult = .error(error.toVK())
                    }
                    
                    if finalResult != nil {
                        strongSelf.currentController?.dismiss()
                    }
                }
            )
            

        }
    }
    
    private func handle(
        result: WebControllerResult,
        originalPath: String,
        fails: inout Int,
        finalResult: inout WebPresenterResult?
    ) {
        do {
            let parsedResult: ResponseParsingResult
            
            switch result {
            case .response(let url):
                parsedResult = try parse(url: url, originalPath: originalPath)
            case .error(let error):
                parsedResult = try parse(error: error, fails: fails)
            }
            
            switch parsedResult {
            case let .response(value):
                finalResult = .response(value)
                
            case .fail:
                fails += 1
                currentController?.reload()
                
            case .nothing:
                break
                
            }
        }
            
        catch let error {
            finalResult = .error(error.toVK())
        }
        
        if finalResult != nil {
            currentController?.dismiss()
        }
    }
    
    private func parse(url maybeUrl: URL?, originalPath: String) throws -> ResponseParsingResult {
        guard let url = maybeUrl else {
            throw VKError.authorizationUrlIsNil
        }
