pass resource object to hooks