update the rewrite plan  model