distinguish failure and invalid