Fix crash in new refresh cache implementation