Fixing email code