add try-catch to cli