added the ability to export to a specific directory