fix checkmate bug