fixing a bug in the email reminders code