add validator for AJAX