fix added order by in iter_messages