corrections to email code