small bug fix to caching