isAjax and isCLI functions added