         data:
           phase:
             task_manager_id: @state.paper.task_manager_id
-            position: column.position
+            position: newPosition
             name: column.name
-        success: (data) =>
-          newPhase = data.phase
-          newPhase.paper = @state.paper
-          newFlows = @state.flows.slice(0) #don't mutate old state
-          newFlows.splice(newPosition, 0, newPhase)
-          @setState flows: newFlows
+        success: (data) => @insertPhase(data.phase)
 
 
   Column: React.createClass

      Tahi.utils.bindColumnResize()

      $.getJSON @props.route, (data,status) =>
        @setState flows: data.flows, paper: data.paper

    componentDidUpdate: ->
      Tahi.utils.resizeColumnHeaders()

          flow.tasks = _.reject flow.tasks, (task) ->
            task.taskId == taskId
          @setState flows: newFlows

    insertPhase: (newPhase) ->
      newPhase.paper = @state.paper
      newFlows = @state.flows.slice(0) #don't mutate old state
      [head, tail] =  _.partition newFlows, (flow) ->
        flow.position < newPhase.position
      _.map tail, (flow) ->
        flow.position += 1
      updatedFlows = head.concat newPhase, tail
      @setState flows: updatedFlows

    addColumn: (position) ->
      newPosition = position + 1
