support CMD and non-CMD