Code for handling stubs in cache in addition to collection