Add explicit braces to avoid dangling else.