diff --git a/remi/gui.py b/remi/gui.py
index <HASH>..<HASH> 100644
--- a/remi/gui.py
+++ b/remi/gui.py
@@ -1591,7 +1591,7 @@ class HEAD(Tag):
                 };
 
                 Remi.prototype._checkTimeout = function(){
-                    if(this._pendingSendMessages.length>0)
+                    if(this._pendingSendMessages !== undefined)
                         this._renewConnection();
                 };
Prevent spurious errors after teardown

we really should clear the timer