modified validate_uniqueness