copy the array when enumerating