fix bug with sending email