     ).fail( (xhr) ->
       Toast.message(xhr.responseJSON.messages)
     ).always( ->
-      toggleIcon()
-    )
-
+      @toggleIcon()
+    )
+

      @ui.uploadAndExploreForm.submit()


  uploadFiles : (event) ->

    event.preventDefault()

    toggleIcon = =>
      [@ui.formSpinnerIcon, @ui.formUploadIcon].forEach((ea) -> ea.toggleClass("hide"))


    toggleIcon()

    form = @ui.uploadAndExploreForm


      Toast.message(annotation.messages)
    ).fail( (xhr) ->
      Toast.error("Error. Please try again.")
    ).always( =>
      @toggleIcon()
    )


