Added a try/catch block