delete cached queries properly