Working ExportItems function