remove hardcode NUM_CMD