fix bug of counting cards