   (log/debug "[hardwallet] sign error: " error)
   (let [tag-was-lost? (= "Tag was lost." (:error error))]
     (fx/merge cofx
-              (if tag-was-lost?
-                (fx/merge cofx
-                          {:db             (-> db
-                                               (assoc-in [:hardwallet :on-card-connected] :hardwallet/prepare-to-sign)
-                                               (assoc-in [:hardwallet :pin :status] nil)
-                                               (assoc-in [:signing/sign :keycard-step] :connect))
-                           :utils/show-popup {:title   (i18n/label :t/error)
-                                              :content (i18n/label :t/cannot-read-card)}}))
+              (when tag-was-lost?
+                (fn [{:keys [db] :as cofx}]
+                  (fx/merge cofx
+                            {:db             (-> db
+                                                 (assoc-in [:hardwallet :on-card-connected] :hardwallet/prepare-to-sign)
+                                                 (assoc-in [:hardwallet :pin :status] nil)
+                                                 (assoc-in [:signing/sign :keycard-step] :connect))
+                             :utils/show-popup {:title   (i18n/label :t/error)
+                                                :content (i18n/label :t/cannot-read-card)}})))
               (if (re-matches pin-mismatch-error (:error error))
-                (fx/merge cofx
-                          {:db (-> db
-                                   (update-in [:hardwallet :pin] merge {:status      :error
-                                                                        :sign        []
-                                                                        :error-label :t/pin-mismatch})
-                                   (assoc-in [:signing/sign :keycard-step] :pin))}
-                          (get-application-info (get-pairing db) nil))
-                (show-wrong-keycard-alert cofx true)))))
+                (fn [{:keys [db] :as cofx}]
+                  (fx/merge cofx
+                            {:db (-> db
+                                     (update-in [:hardwallet :pin] merge {:status      :error
+                                                                          :sign        []
+                                                                          :error-label :t/pin-mismatch})
+                                     (assoc-in [:signing/sign :keycard-step] :pin))}
+                            (get-application-info (get-pairing db) nil)))
+                (show-wrong-keycard-alert true)))))

                  (if (= flow :import)
                    (navigation/navigate-to-cofx :keycard-recovery-pin nil)
                    (navigation/navigate-to-cofx :keycard-login-pin nil)))
        (show-wrong-keycard-alert cofx true)))))

(fx/defn send-transaction-with-signature
  [_ data]

        setup? (boolean (get-in db [:hardwallet :setup-step]))]
    (log/debug "[hardwallet] verify pin error" error)
    (fx/merge cofx
              (when tag-was-lost?
                (fx/merge cofx
                          {:db               (-> db
                                                 (assoc-in [:hardwallet :on-card-connected] :hardwallet/verify-pin)
