fixed nasty bug that prevented emails to be sent