fix the index