Clean cli with exceptions catching and fix bug