change the compare method of keyvalue