Added curly-braces to fix scope