Fixed bug with exporting