added precondition check to certificate