Added better certification handling