updated chec_certificate.sh to add timeout function