fix keyvalue bug