Better error handling for invalid command