Fix redirect after DB is flushed