Call enable_cache function at the right place