refactored to prevent duplicate emails