fixed selected index calc