Added curly brackets to catch statement