Moved afterValidation callback to the form definition