fixed swapping of original and copyied data