added some code to the copy command