Added a try except statement