Added validation to the fields