fix validation for required fields