add try catch block