fixing the error for default checking for the validation and on change