update equal function