fix error with output folder creation if filepath is like ../path/to/some/file.xml