Added check for invalid command