fixed num_cards bug