reset selectedIndex after re-rendering