Add invariant and fix model