Check if cache_needs_updating is set (fixes 'Notice: Undefined variable: cache_needs_updating')