fix stream scope