added some try exception block