fixed crash when using RPC to call a method