added functions for copy Data to device