Another bug

Looks like the site now writes the date at the end of the day instead of the beginning of the next.  The code needs to be cleaned up, but this should work for now.
Only send email on new file save or error