Added braces on if blocks to follow Dart Style Guide