Add curly braces to if statement

changed if statement to be compatible with sonar.