consistency check func.