     @pingerRef = null
     @messageCount = 0
     @lastMessageId = null
-    @initiatedClose = false
     @autoReconnect = @cfg.websocket_auto_reconnect ? true
 
   # Shutdown the WebSocket for good (prevents auto-reconnect)


        # The WebSocket was closed
        @sock.once 'close', =>
          if @autoReconnect == true and @initiatedClose != true
            @sock = null

            if @pingerRef?


    if @sock?
      try
        @autoReconnect = false
        @sock.close()
      catch error
        logger.error "Error while closing WebSocket: #{error}\n#{error.stack}"
      finally
        @sock = null

  # Alias to the close() method
  disconnect: -> @close()
