create root directory before write_page is called
Merge pull request #9 from fotcorn/create_root_dir_fix

Good point, thanks.