no i need the index to set the selected item in line 589