fixes #7 for email sending bug