What's this function outside the `if` block? The whole mapping code must be inside the `if` block since there's no `map` div to link to anymore.