fixes to emailing errors