rewrite key update