fixing up exporting logic