using mr.patel's source. add rpc connection