Add a try catch block to catch an error