using ensure resource