add Assertion statement in setSelectedIndex