modified number of emails to send function