fixed some caching problems