adds ensure function from later version