code: protected void removeExistingEntity(String localId) {
  		if (StringUtils.isEmpty(localId))
  			return;
  		List<Scope> scopes = projectRepo.getScopeIdById(localId);
  
  		if (CollectionUtils.isEmpty(scopes))
  			return;
  
  		ObjectId tempEntId = scopes.get(0).getId();
  		if (localId.equalsIgnoreCase(scopes.get(0).getpId())) {
  			projectRepo.delete(tempEntId);
  		}
  	}
docs: Validates current entry and removes new entry if an older item exists in
  the repo
  
  @param localId
  local repository item ID (not the precise mongoID)