add try catch to rpc server