appended exit code
added error code handling todo