Create directories first to work around bug