fix handle thread index