- fixed copyResources function