adds try/catch block