Check whether setting isValid before converting toBool