Updated code to fix issue of email.