Added debug mode off check for emails already in the db and not sent.