Add the check if there is URI before calling rpc functions