restored counter and num segs