Set custom validity only after AJAX is done