Added failure handler.