- add better error handling and error output message