Fix cache refresh bug