Added validation to the view