fixed stalemate and checkMoves method