added write-dir