added code for inverse caching