fixes #3

make sure dire exists before you copy the file