Copy vector in foreach