caching added to prompt code