fixed checkmate bug