bug fix in model unique validation