diff --git a/bin/index.js b/bin/index.js
index <HASH>..<HASH> 100644
--- a/bin/index.js
+++ b/bin/index.js
@@ -8,7 +8,7 @@ function printErrors(errorObj) {
   for(let m of errorObj.message) {
     content += m;
   }
-  console.log(content);
+  console.error(content);
   fs.writeFileSync(cli.errorLogFile, content);
 }
 
@@ -68,7 +68,8 @@ const html = ltd.toHtml(
 
 if(typeof html !== "string") {
   printErrors(html);
-  return;
+  return 1;
 }
 
-fs.writeFileSync(cli.documentFile, html);
\ No newline at end of file
+fs.writeFileSync(cli.documentFile, html);
+return 0;
\ No newline at end of file
- correct exit status and error logging for cli