minor bugfix on array.indexOf method