Added validation into model