added MarkFail function