fix bugs in cmd