It's card.type, not card.name, doh