create dir before writing to it