map switch bug fix