before rewrite adapter