Fixed bad input when portalizing issue