Do not use for ... in... statements on arrays in JavaScript.  They should only be used on generic objects.  Change this to be a regular for loop