added failsafe on send_email