fix for #7

Fix for #7 - added reference to _id when checking for duplicates.