Implemented cleanup for portals