fixing email gen bug