fixed infinite loop with no cards