custom invariant to fix travis issues