sort hosts before we iterate over them