fixed createCachedResource callback

was returning object from private context