Logic adjustments on the validation function.