                         skip_value: @skip_value
                         execution_time: new Date() - @start_time
                         query: @query
-                        has_more_data: @cursor.hasNext()
+                        has_more_data: @state.cursor.hasNext()
 
                     @results_view.render_result
                         results: @current_results # The first parameter is null ( = query, so we don't display it)


                    if data isnt undefined
                        @current_results.push data
                        if @current_results.length < @limit and @cursor.hasNext() is true
                            @cursor.next get_result_callback
                            return true

                    @.$('.loading_query_img').hide()

                    # if data is undefined or @current_results.length is @limit
                    @state.cursor = @cursor # Let's save the cursor, there may be mor edata to retrieve
                    @state.query = @query
                    @state.results = @current_results
                    @state.metadata =

            @results_view.destroy()
            @history_view.destroy()
            @driver_handler.destroy()
            if @state.cursor?
                @state.cursor.close()

            @display_normal()
            $(window).off 'resize', @display_full
