Added code to handle exporting users as csv file