Set index when creating tasks