make card formatting a little more robust