error checking on cache retrieve