add some code for portal view