added unique constraint check to the models validation