Fix for large number of cards, optimization