added support for STREAM mode