fixed a issue in copyfile.