finished adding code for auto cache clear