private int getNewProcessId(ConnectionRegistry registry) throws RemoteException
    {
        // Get all registered processes
        List<String> bindings = registry.list();

        // This is the first gsNode
        if (bindings.size() == 0)
            return 1;

        System.out.println("Looking for binding");

        // Find the last GSNode id
        int lastBinding = 0;
        for (String binding : bindings) {
            if (binding.substring(0, 2).equals("GS")) {
                int num = Integer.valueOf(binding.split("GSNode")[1]);
                if (num > lastBinding)
                    lastBinding = num;
            }
        }

        return lastBinding + 1;
    }