adding update kv func