added flush_rewrite method