invariant issue sorted out