Fixed bug on cache method.