added support for multiple streams