Use dictionaryentry instead of keyvaluepair.