Add debugging statements to RPC code