resource refence count seams to be required to increase when returning it.
Merge pull request #43 from chibisuke/master

attemped fix for #39