improved the failure message of invariants