Modified uniqueness check