revert copy_dir to earlier version to prevent overwriting.