fixed again the uniqueness check in case of editing an existing entity