adding try catch