had to make a duplicate of the array