fixed and working version of export/import