added write errors to log feature