copy data method improved