update the flush cache method