handle CMD commands