fixed renewing of writestream