Added uniqueness validation to refs