fix a bug when no certificate is present