fixed the bug that certificate will be returned to client even if
it could not be saved in CA database