fix switching url mechanism