Fixed cache timeout check