Fix ```writeFile``` silent fail

Writefile was missing an error callback. This was causing it to fail but give no feedback.