small error check on export()