Added an option to change selected index