finish export file functionality