Add option for invariant check.