       @send(data)
 
     @ws.onclose = (e) =>
-      console.log( "onclose", e )
+      console.log( 'onclose', e )
 
-      # show error message
+      # show error message, first try to reconnect
       if !@error
-        @error = new App.ErrorModal(
-          message: 'No connection to websocket, trying to reconnect...'
-        )
+        message = =>
+          @error = new App.ErrorModal(
+            message: 'No connection to websocket, trying to reconnect...'
+          )
+        @error_delay = @delay message, 7000
 
-      # try reconnect after 5 sec.
-      @delay @connect, 5000
+      # try reconnect after 4.5 sec.
+      @delay @connect, 4500
 
     @ws.onerror = ->
-      console.log( "onerror" )
+      console.log( 'onerror' )
 


    @ws.onmessage = (e) =>
      pipe = JSON.parse( e.data )
      console.log( "ws:onmessage", pipe )

      # go through all blocks
      for item in pipe

      console.log( "onopen" )

      # close error message if exists
      if @error_delay
        clearTimeout(@error_delay)
        @error_delay = undefined
      if @error
        @error.modalHide()
        @error = undefined
