implement consistency check