add try catch clauses