fixed uniqueness check