null check on email sending