using ensure resouce