             return tagged_callback
 
         execute_query: =>
+            clearTimeout @timeout
+            @timeout = setTimeout @connect
             window.result = {}
 
             @query = @codemirror.getValue()

                window.conn.close()
            catch err
                #console.log 'Could not destroy connection'
            clearInterval @interval

    
    class @InputQuery extends Backbone.View
        className: 'query_control'

                @has_been_initialized.value = true
            
            @connect()
            @timeout = setTimeout @connect
            window.r = rethinkdb.query
            window.R = r.R

            # We escape the last function because we are building a regex on top of it.
            @unsafe_to_safe_regexstr = []
