fix the key value lost bug