Fixed a minor bug

This bug was causing many emails getting sent to same email address.

I will soon add tests to check this but pushing this change to fix it for now.