better handling of check/checkmate