update code of copypath