fix portal crash