fixed bug with mail not being saved correctly