ensure the correct error messages are always return