fix validation for nullable fields