Fixed file caching bug