more reworking of createWriteStream