add function to export file