Changed the way the exporting works so hopfully it wont crash again.