PortalKit: fix the problem that error occured in release mode
PortalKit: add remains stuff