fix target switch bug