distinct in iter_messages