add a function for clearing the detector cache