How To Check If Commands Are Valid