Added registere entity mothod discarding all old entity ids.