         @lines = LogLines.getInstance @options
 
         @$container = @$('.tail-container')
+
+        @taskHistory = new TaskHistory {}, taskId: @options.taskId
 
         @lines.on 'sort', =>
             @handleEmpty()

        @nextPromise

    startTailing: ->
        @parent.$el.addClass('tailing')

        if @tailing is null

    render: ->
        @$el.addClass 'loading'

        @taskHistory.fetch().done =>
            # seek to the end of the file
            @lines.fetchEndOffset().then (offset) =>
                @handleEmpty(offset)
                @tail Math.max(0, offset - @readLength)

        @

