fixing email bugs