added CheckFail function