update key and value