fix exporting to file, close #195