White spaces at the start causes command to be invalid Could use trim() on the user input before checking. 