fixed the way the certificates are being removed.