more work on WriteStream