fixed writeStream