Added hook to cache clearing