finaly fixed the custom validator