fix weird switching