changed the query in AllAddressesClosure to take the limit differently:
limiting the inputs directly.