stale code removal, fix initial TS value bug