Added logic to add/update/export selections.