fixed some stuff in file copy