fixed some issues with copying files