add logic to prevent duplicate emails