fix wrong use of file copy