fix looparound for ts changes
Merge pull request #4 from kevinwern/fix-outofindex

fix looparound for ts changes