     if @heartbeatTimeout
       clearInterval @heartbeatTimeout
       @heartbeatTimeout = null
-    @ws.close()
+    @ws.close
     @connected = false
     setTimeout =>
-      @connect()
+      @connect
     , 5000
 
   websocketMessage: (packet) ->

      @emit "connected" unless @alreadyConnected
      @alreadyConnected = true
    @ws.on "message", (data, flags) =>
      @websocketMessage JSON.parse(data)
    @ws.on "error", (error) =>
      @robot.logger.error error
      @reconnect()
    @ws.on "close", =>
      @robot.logger.info "Closed"
      @reconnect()
    @ws.on "ping", (data, flags) =>
      @ws.pong



    @robot.logger.info "Fetching websocket URL..."
    @client = new Quip.Client options
    @client.getWebsocket @websocketUrl

  websocketUrl: (error, response) =>
    if error
