fixed equal function