rewrite update