Adding onValidated event