handle cache expiration correctly