added some more error handling to the cli creation