added debug log capability
fixed issue with email notifications