Fixed not checking presence of index in html select