Add function checkFail; show loss message if fail