Bug fix

Change-Id: I818c36291854a9658963c524899ffee2e2f19410
Don't make an extra query to db to get resource.

Change-Id: I401e27c7e5add8fe5734af593da385f93e6085a1