       @__setState 'waiting'
 
     __setImage: (@__url) ->
-      @__deferred = $.Deferred()
       @__img = $('<img/>')
         .css
           margin: '0 auto'

    __buildWidget: ->
      @container = $ @__options.container
      @__widgetElement = $(tpl('crop-widget')).appendTo @container
      [@__widgetWidth, @__widgetHeight] = @__widgetSize()
      @__setState 'waiting'

    __clearImage: ->
      @__jCropApi?.destroy()
      if @__deferred and @__deferred.state() is 'pending'
        @__deferred.reject(IMAGE_CLEARED)
        @__deferred = false
      if @__img
        @__img.remove()
        @__img.off()


    croppedImageCoords: (previewUrl, size, coords) ->
      @__clearImage()
      @__calcSizes size
      @__setImage previewUrl
      @__initJcrop coords
      @__deferred.promise()
