fix uniqueness scoping bug