Fix validation logic.