   removeChild: (task) ->
     i = @_children.indexOf task
     if i > -1
-      @_children.splice i, 1
+      @_children[i] = null
       task._parent = null
     return @
 

    @_parent?.removeChild this

    for child in @_children
      child.destroy()

    return @


      return @
    else
      for child in @_children
        if child?
          task = child.getTaskById id
          return task if task?
      return null

DivSugar.rootTask = new DivSugar.Task('rootTask')
