setStream method added