fixed the sendEmails function.  Please be Happy