--- a/wvdetection.js
+++ b/wvdetection.js
@@ -717,24 +717,33 @@
 
     /**
      * Start the webvisu detection with the specified wait timeout
-     * @param timeout ms waiting for new messages (default 5000ms).
+     * @param timeoutForMessageFromWebvisu ms waiting for new messages (default 5000ms).
+     * @param numberOfRegistrationMessages the number of registration retry messages before switching to the next url
      */
-    start(timeout) {
-        if (timeout === undefined || timeout === null) {
-            timeout = 5000;
-        }
-        if (typeof timeout !== "number") {
-            throw Error("Timeout has to be a number!")
+    start(timeoutForMessageFromWebvisu, numberOfRegistrationMessages) {
+        if (timeoutForMessageFromWebvisu === undefined || timeoutForMessageFromWebvisu === null) {
+            timeoutForMessageFromWebvisu = 5000;
+        }
+        if (numberOfRegistrationMessages === undefined || numberOfRegistrationMessages === null) {
+            numberOfRegistrationMessages = 2;
+        }
+        if (typeof timeoutForMessageFromWebvisu !== "number") {
+            throw Error("TimeoutForMessageFromWebvisu has to be a number!")
+        }
+        if (typeof numberOfRegistrationMessages !== "number") {
+            throw Error("NumberOfRegistrationMessages has to be a number!")
         }
         if (!Array.isArray(this.urls) || this.urls.length < 2) {
             throw Error("setWebvisuUrls has to be called!");
         }
 
-        this.timeout = timeout;
+        this.timeout = timeoutForMessageFromWebvisu;
+        this.numberOfRegistrationMessagesAllowed = numberOfRegistrationMessages;
         this.isStarted = true;
         const self = this;
         this.frame.addEventListener("load", function() {self.onLoad()});
         this.activeIndex = 0;
+        this.numberOfRegistrationMessages = 0;
         this.frame.src = this.urls[this.activeIndex];
         console.info("Webvisu detection started!");
     }
@@ -752,6 +761,7 @@
         if (this.activeIndex >= this.urls.length) {
             this.activeIndex = 0;
         }
+        this.numberOfRegistrationMessages = 0;
         this.frame.src = this.urls[this.activeIndex];
     }
     onMessageFromFrame(event) {
@@ -764,8 +774,13 @@
             }
             var message = event.data;
             if (message === "--INFO--\"Still polling the registration of the visualization. Is the visu stopped?\"") {
-                console.log("Webvisu stopped? Switching to different url!");
-                setTimeout(function() {self.switchToDifferentUrl()}, 1000);
+                this.numberOfRegistrationMessages++;
+                if (this.numberOfRegistrationMessages >= this.numberOfRegistrationMessagesAllowed) {
+                    console.log("Webvisu stopped? " + this.numberOfRegistrationMessages + " registration failed! Switching to different url!");
+                    setTimeout(function () {
+                        self.switchToDifferentUrl()
+                    }, 1000);
+                }
             }
             if (message === "Error while processing the visualization: Sending service aborted") {
                 console.log("Download? Switching to different url!");