Reordered the flushing of caches