added ability to intercept and edit stream