 
     fadeTo = (to, duration) ->
         (text_object) ->
-            current = text_object.children[0].material.uniforms.opacity.value
+            current = if text_object.children[0]?
+                text_object.children[0].material.uniforms.opacity.value
+            else 0
             i = d3.interpolate current, to
             getTransitionPromise(i, duration) text_object
 

                            .filter (child) -> child isnt node
                        parent = node._parent
                        promises = siblings.concat(parent).map (child) ->
                                # word_object = _getOneWord child._text_object, node.word
                                fadeTo(0, 1000) child._text_object
                        return Promise.all promises
                .then ->
                    # Fade in children
                    if node.children?
                        promises = node.children.map (child) ->
                             fade(0.2, 1, 1000) child._text_object
                        return Promise.all promises
                .then ->
                    # Traverse next parent


            traverse(root)

    getWordObjects: (text_object, word) ->
        word_object = new THREE.Object3D()
        begin = getWordIndex text_object._line, word
        end = begin + word.length
        text_object.children.slice begin, end

    animateLines: (root) =>
        # _getOneWord = @getOneWord
        traverse = (node) =>
            return if ! node.children?

