checking some invariants