Added a little error handling for commandline app