get the selected index