fix issue where a valid pointer would be returned if a command could not be found