Fix duplicate agency_id field if something went wrong while saving.