update copy function