             @_num_attempts = 0
 
             conn.removeAllListeners('data')
+            conn.on("data", ondata)
 
             if auth_token?
                 @sign_in_using_auth_token

                factor  : 1.3
                retries : 100000

        misc_page.delete_cookie('SMCSERVERID3')
        @_delete_websocket_cookie()
        conn = new Primus(url, opts)

        @_conn = conn

        if @_connected
            return @_conn.latency

    _fix_connection: =>
        console.log("websocket --_fix_connection... ")
        @_conn.end()
        @_conn.open()

