       @interval = setTimeout bind, 0
 
     stopWatching: ->
-      clearTimeout @interval if @interval
+      if @interval
+        clearTimeout @interval
       @interval = null
 
     __updateStatus: ->
-      utils.jsonp("#{@settings.urlBase}/status/", {@token})
+      utils.jsonp(@poolUrl, {@token})
         .fail (error) =>
           @stopWatching()
-          @uploader.__state 'error'
+          $(this).trigger 'error'
         .done (data) =>
-          @uploader.__state data.status, data if data.status in ['progress', 'success', 'error']
+          $(this).trigger data.status, data

namespace 'uploadcare.files', (ns) ->

  class ns.UrlFile extends ns.BaseFile
    constructor: (settings, @__url) ->
      super
      @__shutdown = true

      filename = utils.splitUrlRegex.exec(@__url)[3].split('/').pop()
      if filename

      @__notifyApi()

    __startUpload: ->
      pusherWatcher = new PusherWatcher(@settings.pusherKey)
      pollWatcher = new PollWatcher("#{@settings.urlBase}/status/")
      @__listenWatcher($([pusherWatcher, pollWatcher]))

      # turn off pollWatcher if we receive any message from pusher
      $(pusherWatcher).one @allEvents, =>
        pollWatcher.stopWatching()

      data =
        pub_key: @settings.publicKey
