fix bugs for shell command