fix bug for copy metadata