create folders before trying to copy files into them

This commit should fix the issue.