Fixed bug in pdf caching