                 "Transfer-Encoding":    "identity"
                 
             # register ourself as a listener
-            @caster.registerListener(@)
+            #@caster.registerListener(@)
             
             # write out our headers
             res.writeHead 200, headers
             
-            @dataFunc = (chunk) => @res.write(chunk)
+            @dataFunc = (chunk) => 
+                #console.log "chunk: ", chunk
+                @res.write(chunk)
 
             # and register to sending data...
             @caster.rewind.addListener @dataFunc, offset

            console.log "frames per sec is ", @framesPerSec
            console.log "adding a listener with offset of ", offset
            
            #tmpf = fs.createWriteStream "/tmp/rewind.buffer", flags:"w"
            
            if @buffer.length > offset
                console.log "Granted. current buffer length is ", @buffer.length
                @listeners.push [ callback, offset ]#, tmpf ]
                return offset
            else
                console.log "Not available. Instead giving max buffer of ", @buffer.length
                @listeners.push [ callback, @buffer.length ]#, tmpf ]
                return @buffer.length
        
        #----------
        
        removeListener: (callback) ->
            #@listeners = _u(@listeners).without(obj)
            return true
            
                if !@header
                    @header = header
                    @framesPerSec = header.samplingRateHz / header.samplesPerFrame
                    
                #console.log "header is ", header
                    
                @lastHeader = data
                        
