Added a failure state handler.