This re-defines `locMessage`. Uplift the `var` to before the `if`