correction with Stalemate detection