fix raise in ensure