bind dispatch hooks for rpc

This fixes issue 525.

I think this should be merged as quickly as possible since all RPC projects won't compile at the moment.