fix email sending in the backend