changing $.inArray for indexof