Added the try/catch block