Work on email and better logging