copytree() bug fix