some fixes with email sending