tweak processStream logic.