update compare method