Added cache flushing