add _invalid_cmd function