add support for using your own streams