Fixed build error - wrap if statement in curly brackets