         questionsOrder: []
         questions: {}
         questionsMap: {}
-      @props.workflow.update 'tasks'
+      @props.onChange @props.task
       @clearState()
 
   resetMedia: (e) ->

  handleImageAdd: (media) ->
    @setState resettingFiles: true
    @props.task.images[media.metadata.filename] = media.src
    @props.workflow.update('tasks').save()
      .then =>
        @setState resettingFiles: false

  handleImageDelete: (media) ->
    @setState resettingFiles: true
    delete @props.task.images[media.metadata.filename]
    @props.workflow.update('tasks').save()
      .then =>
        @setState resettingFiles: false


    @props.task.questionsMap = newTask.questionsMap
    @props.task.questionsOrder = newTask.questionsOrder

    @props.onChange @props.task
      .then =>
        @clearState()

