make tids always 0-indexed