flush cache on exit