Fix a copy file bug