using resource object for context