Added some validation to the input command