more robust caching