portal function