         @xhr.addEventListener 'error timeout abort', @__onError
         @xhr.addEventListener 'loadstart', @__onStart
         @xhr.addEventListener 'load', @__onLoad
-        @xhr.addEventListener 'loadend', => @__onError() unless @xhr.status
+        @xhr.addEventListener 'loadend', => @__fail() unless @xhr.status
         @xhr.upload.addEventListener 'progress', @__onProgress
         @xhr.send formData
 

        @fileSize = file.size
        @fileName = file.name

        formData = new FormData()
        formData.append('UPLOADCARE_PUB_KEY', @settings.publicKey)
        formData.append('UPLOADCARE_FILE_ID', @fileId)

        @iframe = null
        @iframeForm = null

      __fail: -> @__onError()

      __onError: => $(this).trigger('uploadcare.api.uploader.error')
      __onStart: => $(this).trigger('uploadcare.api.uploader.start')
      __onLoad: => $(this).trigger('uploadcare.api.uploader.load')
