Updated script to work with new JSON-RPC