Added callback onValidate