Dup the array to avoid changing the main array