fixes bug with caching files