Update sorting, fix double call bug and ui updates for agreement search.