     @IBAction func clickCard(sender: NSTableView) {
         guard sender.clickedRow >= 0 else { return }
         let card = currentDeck!.sortedCards[sender.clickedRow]
-        currentDeck!.removeCard(card)
-
-        isSaved = false
-
-        deckCardsView.reloadData()
-        cardsCollectionView.reloadData()
-        curveView.reload()
+        
+        undoCardAdd(card)
     }
 
     func addCardToDeck(card: Card) {

    var currentHealth = -1
    var currentRace = ""
    var currentCardType = ""

    var monitor: AnyObject? = nil


                         name: "theme",
                         object: nil)

        deckUndoManager = window?.undoManager
        initKeyboardShortcuts()
    }

