Added card counter to stack and migrated database