Avoid dangling else

put brace in if statement is good way to avoid ambiguity.