Bug fix in cardName() function