Fix bug for copy dir