added function to verify certificate