Added flush cache method