ensure logic