adds try catch