diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index 9e10619..98d210f 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -15,48 +15,54 @@
               $rootScope, $scope, dataService, userModel, $location, $route) {
             $scope.dataService = dataService;
 
-            // Create a secure websocket with URL as /subscribe
-            // TODO: Need to put in a generic APIUtils to avoid duplicate
-            // controller
-            var ws =
-                new WebSocket('wss://' + dataService.server_id + '/subscribe');
+            try {
+              // Create a secure websocket with URL as /subscribe
+              // TODO: Need to put in a generic APIUtils to avoid duplicate
+              // controller
+              var ws = new WebSocket(
+                  'wss://' + dataService.server_id + '/subscribe');
+            } catch (error) {
+              console.log('WebSocket', error);
+            }
 
-            // Specify the required event details as JSON dictionary
-            var data = JSON.stringify({
-              'paths': ['/xyz/openbmc_project/state/host0'],
-              'interfaces': ['xyz.openbmc_project.State.Host']
-            });
+            if (ws !== undefined) {
+              // Specify the required event details as JSON dictionary
+              var data = JSON.stringify({
+                'paths': ['/xyz/openbmc_project/state/host0'],
+                'interfaces': ['xyz.openbmc_project.State.Host']
+              });
 
-            // Send the JSON dictionary data to host
-            ws.onopen = function() {
-              ws.send(data);
-              console.log('host0 ws opened');
-            };
+              // Send the JSON dictionary data to host
+              ws.onopen = function() {
+                ws.send(data);
+                console.log('host0 ws opened');
+              };
 
-            // Close the web socket
-            ws.onclose = function() {
-              console.log('host0 ws closed');
-            };
+              // Close the web socket
+              ws.onclose = function() {
+                console.log('host0 ws closed');
+              };
 
-            // Websocket event handling function which catches the
-            // current host state
-            ws.onmessage = function(evt) {
-              // Parse the response (JSON dictionary data)
-              var content = JSON.parse(evt.data);
+              // Websocket event handling function which catches the
+              // current host state
+              ws.onmessage = function(evt) {
+                // Parse the response (JSON dictionary data)
+                var content = JSON.parse(evt.data);
 
-              // Fetch the current server power state
-              if (content.hasOwnProperty('properties') &&
-                  content['properties'].hasOwnProperty('CurrentHostState')) {
-                // Refresh the host state and status
-                // TODO: As of now not using the current host state
-                // value for updating the data Service state rather
-                // using it to detect the command line state change.
-                // Tried different methods like creating a separate
-                // function, adding ws under $scope etc.. but auto
-                // refresh is not happening.
-                $scope.loadServerStatus();
-              }
-            };
+                // Fetch the current server power state
+                if (content.hasOwnProperty('properties') &&
+                    content['properties'].hasOwnProperty('CurrentHostState')) {
+                  // Refresh the host state and status
+                  // TODO: As of now not using the current host state
+                  // value for updating the data Service state rather
+                  // using it to detect the command line state change.
+                  // Tried different methods like creating a separate
+                  // function, adding ws under $scope etc.. but auto
+                  // refresh is not happening.
+                  $scope.loadServerStatus();
+                }
+              };
+            }
 
             $scope.loadServerHealth = function() {
               APIUtils.getLogs().then(function(result) {
