trying to fixed the undefined selectedIndex error in indicator selector