add failure handler