improving error handling from command line