fix non-persistent caching logic