add try catch exception hanlde in ShowMsg2 function