adding try/catch block