fixes portentities and entities