Fixed a logical error in the required validation.