updated selected index