add copyline function