adds caching to stub.