Bugfix for rpc disconnect function