 
     private func saveMatch(rank: Int, note: String, playerClass: CardClass,
                            opponentName: String, opponentClass: CardClass, opponentRank: Int) {
-        guard let currentDeck = self.currentDeck else {
-            Log.info?.message("No deck, ignore statistic")
-            return
-        }
-
         DispatchQueue.main.async { [weak self] in
             guard let strong = self else { return }
             do {
                 let realm = try Realm()
-                guard let deck = realm.objects(Deck.self)
-                    .filter("deckId = '\(currentDeck.id)'").first else {
-                        Log.error?.message("Can not get deck")
-                        return
-                }
+                let deck = realm.objects(Deck.self)
+                    .filter("deckId = '\(strong.currentDeck?.id)'").first
 
                 let statistic = Statistic()
                 statistic.opponentName = opponentName

        }
    }

    private func syncStats(deck: Deck, statistic: Statistic) {
        guard currentGameMode != .practice && currentGameMode != .none else {
            Log.info?.message("Game was in \(currentGameMode), don't send to third-party")
            return
        }


                    startTime = Date()
                }

                let endTime = strong.gameEndDate ?? Date()

                statistic.duration = Int(endTime.timeIntervalSince1970
                    - startTime.timeIntervalSince1970)
