Fixed the export functionality