From the vague information you're giving I guess the following:
- The user adds a new record to a list of address records
- Before the record is added you're checking whether the email address is unique (which works => the record is added)
- When the user changes the record, the email check fails
I suppose that you fail to consider the case that you're comparing the same records. Assume the following:
- You have records A and B, which both have unique email addresses
- User enters new record, you validate eMail address C against A and B => unique, you add record C
- User modifies record C, you compare eMail address against all known records, so you compare eMail address C with A, B and C => Of course, the eMail address is already known.
You should modify your check so that the condition is: eMail address already exists if a record with the same eMail address is found and the record is not the same as the one being edited right now.
But again: The information you're giving is very vague - I might be far off the right track here...