isCLI and isAjax functions added