Added the check for "is_ajax"