added logging and bug fix to prevent AI players from taking turns when they have no cards.