Parameter for Arrary.indexOf should be the value of the element.

Parameter for Arrary.indexOf should be the value of the element, not the index of the element.