fix on file copy + cleanup