first erase text, then rewrite