add certificate check