Fix cache returning nil always bug