WriteStream and scriptRemainder