fix stream not closing correctly
1.1.1