fixed useportal command and removed debugging statements