Fixing switch bug