     get_capsule: (params) ->
         key = JSON.stringify params
         ob = @capsules[key]
-        if not grid?
+        if not ob?
             {sin, cos} = Math
             ob = @capsules[key] = new @context.Mesh
             {radius, height} = params

            ob.data.draw_method = @context.render_manager.gl.LINES
            ob.rotation_order = 'Q'
            ob._update_matrices()

        @grids = {}
        @capsules = {}

        # TODO: draw something else when it's too small (a different arrow?)
        #       and a circle when it's 0
        dob = shapes.arrow
        dob.radius = vec3.len vector
        color4.copy shapes.color, color
        vec2.set shapes.discontinuity, 1, 1
        vec3.copy dob.position, position
