Check to ensure that writeStream exists before writing

Fixes #62