alter command key validation logic.