copy src to prevent the user supplied argumet from being changed