fixing condition to send email.