added card count functionality