move email_count to deliver method