fix debug statement
support for custom streams