fix duplicate copying