Own exception handling added end sending emails added