smarter handling of the export dir