edit isAjax method