added a consistency check