Use selectedIndex instead of storing index in value