Tweaked the email results. Error handled file writes