Fixed file copy bug