added consensus isValid().