             callback()
           , 100
 
-        p.removeAllListeners()
         counter = 0
         hadData = false
         p.on 'begingroup', (grp) ->

        , (data, groups, out) ->
          out.send { x: data.x, y: data.y }

        p.removeAllListeners()
        counter = 0
        hadData = false
        p.on 'begingroup', (grp) ->

        , (data, groups, out) ->
          out.send { x: data.x, y: data.y, z: data.z }

        groups = []
        p.on 'begingroup', (grp) ->
          groups.push grp
