Added braces for if-statement