fix null pointer in checkConsistency