fix subscriber
add resource handling logic and tests
fix problem w/ subscriber crashing on exit
take into account subresources