Fixed the NPE that occurs when cards is not set