make sure TS is always an int