use of invariant has been an error for a while