add copy function when user commit