Fix error in loan caching