code for to switch portal