added logic for removing entity from mapping