updated thread index()