also clear the index when the vector is cleared