diff --git a/exec/load/geoip.js b/exec/load/geoip.js
index b4a8ee1ef2df1a3ffa03b9e773f5d8da414d6e38..0cec8b4b580d5ca1ccb5bf29f6398a6e0fcf29c5 100644
--- a/exec/load/geoip.js
+++ b/exec/load/geoip.js
@@ -60,10 +60,10 @@ function get_geoip(host, countryonly)
 	}
 	for(i=0; i<10; i++) {
 		try {
-			do {
-				result='ret='+new HTTPRequest().Get(geoip_url);
-				GeoIP=js.eval(result);
-			} while(GeoIP==undefined);
+			result='ret='+new HTTPRequest().Get(geoip_url);
+			GeoIP=js.eval(result);
+			if(GeoIP==undefined)
+				continue;
 			if(GeoIP.Locations != undefined) {
 				if(isarray)
 					return GeoIP.Locations;