fix exception handling
handle <copyfile>