fix stream operation