Adding check for uniqueness before saving