fix bugs in OffsetManager