fixed non-pointer invariant error