diff --git a/src/obs-remote.js b/src/obs-remote.js
index <HASH>..<HASH> 100644
--- a/src/obs-remote.js
+++ b/src/obs-remote.js
@@ -105,7 +105,9 @@
         };
 
         this._socket.onclose = function() {
-            self.onConnectionClosed();
+            if (self._connected) {
+                self.onConnectionClosed();
+            }
             self._connected = false;
         };
added check to see if connected when web socket is closed