if stream is not writable, now raise IOError instead of return

fix memo write
update demo