Wait until exit to write status caches
properly clean the cache