changed callback handling in cache method