fix bugs in email