Fix issue with bad assignament to arrays

This behavior brokes array normal behavior. Using Array.prototype.indexOf fix the issue