more on_rewrite callbacks