fixed cmd_exists