small changes in the mail sending part