diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go
index 34c9a39f3b9b0159f45c78fabc2104946c871b8e..68164d05cbf9f8298c8c7981424ea451b6af4af6 100644
--- a/ethstats/ethstats.go
+++ b/ethstats/ethstats.go
@@ -256,11 +256,11 @@ func (s *Service) loop() {
 			header.Set("origin", "http://localhost")
 			for _, url := range urls {
 				c, _, e := dialer.Dial(url, header)
-				if e == nil {
+				err = e
+				if err == nil {
 					conn = newConnectionWrapper(c)
 					break
 				}
-				err = e
 			}
 			if err != nil {
 				log.Warn("Stats server unreachable", "err", err)
@@ -275,7 +275,6 @@ func (s *Service) loop() {
 				continue
 			}
 			go s.readLoop(conn)
-
 			// Send the initial stats so our node looks decent from the get go
 			if err = s.report(conn); err != nil {
 				log.Warn("Initial stats report failed", "err", err)