Only add where clause based on elementId, if it is not null. Something was going wrong when adding a new entry, so that it was returning a false positive for the validation because the elementId being checked was blank.
Merge pull request #3 from monachilada/fix-new-entry

Only add where clause based on elementId, if it is not null.